相关疑难解决方法(0)

使用阵列作为strpos中的针

strpos在搜索字符串时如何使用针数组?例如:

$find_letters = array('a', 'c', 'd');
$string = 'abcdefg';

if(strpos($string, $find_letters) !== false)
{
    echo 'All the letters are found in the string!';
}
Run Code Online (Sandbox Code Playgroud)

因为在使用它时,它不起作用,如果有这样的东西会很好

php arrays strpos

79
推荐指数
6
解决办法
13万
查看次数

String包含数组中的所有项(不区分大小写)

如何检查a是否$string包含数组中表达的任何项?

$string = 'My nAmE is Tom.';
$array = array("name","tom");
if(contains($string,$array))
{
// do something to say it contains
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

php arrays string contains

26
推荐指数
6
解决办法
4万
查看次数

标签 统计

arrays ×2

php ×2

contains ×1

string ×1

strpos ×1