我想知道PHP中有没有什么函数可以搜索字符串中的字符串并返回布尔值,来判断字符串是否包含,就像Java中的方法包含的那样?
发布于 2012-07-14 03:37:07
您可以尝试使用strpos()、http://php.net/strpos
$str = "This is a sample string.";
$findMe = "sample";
if (strpos($str, $findMe) !== false) {
// you found me!
}https://stackoverflow.com/questions/11477200
复制相似问题