PHP stripos() 函數(shù)
定義和用法
stripos() 函數(shù)返回字符串在另一個字符串中第一次出現(xiàn)的位置。
如果沒有找到該字符串,則返回 false。
語法
stripos(string,find,start)
參數(shù) | 描述 |
---|---|
string | 必需。規(guī)定被搜索的字符串。 |
find | 必需。規(guī)定要查找的字符。 |
start | 可選。規(guī)定開始搜索的位置。 |
提示和注釋
注釋:該函數(shù)對大小寫不敏感。如需進行對大小寫敏感的搜索,請使用 strpos() 函數(shù)。
例子
<?php
echo stripos("Hello world!","WO")
;
?>
輸出:
6