Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种方法来确定一个单词是否在一组字符中的某个位置。例如,如果单词“looking”在“hereisthewordim*looking*for”中
if( strpos("looking", "hereisthewordimlookingfor") !== false) { echo "true"; }
您需要替换参数:
strpos("hereisthewordimlookingfor", "looking")
我想你正在寻找这个:
if(stristr("hereisthewordimlookingfor","looking")) { echo "true"; };