【发布时间】:2017-09-09 13:59:16
【问题描述】:
我们有一个类似的字符串:
$string="Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
所以我想检查该字符串中是否有可用的单词。例如:
$words=['Ipsum','54'];
你可以看到Ipsum在字符串中但54不在字符串中,所以函数应该回调true(因为找到了Ipsum)。
我正在使用php,感谢您的帮助。
【问题讨论】:
-
***
$words = array('Ipsum','54'); -
自己创建一个函数并将strpos放入其中
-
你应该使用 strpos,对 $words 数组运行 foreach() 并在 foreach 中使用 strpos。
-
查看侧边栏中的this 问题。
标签: php