📜  php 查找子字符串是否在字符串中 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:52.600000             🧑  作者: Mango

代码示例3
// this method is new with PHP 8 and above
$haystack = "Damn, I wonder if this string contains a comma.";
if (str_contains($haystack, ",")) {
    echo "There is a comma!!";
}