L. MIS's Archiver
論壇
›
PHP函數(5.4版)
› strpos()-找出字串第一次出現的位置
admin
發表於 2023-7-27 11:30:57
strpos()-找出字串第一次出現的位置
strpos($haystack, $pos, [$offset])
說明:
$haystack:被搜索的字串
$pos:要查找的字符
$offset:為選項,此選項為設定開始搜尋的位置
傳回參數 pos在字串 haystack中第一次出現的位置,由左至右漸進式的搜尋,以數字表示,會區分大小寫,不適合中文字的搜尋
若找不到指定的字串,則返回 false 值
PS:與 strrpos() 函數功能相異
程式碼範例:
執行結果:
頁:
[1]
查看完整版本:
strpos()-找出字串第一次出現的位置