1.stripos — 查找字符串首次出現的位置(不區分大小寫)
int stripos ( string $haystack , string $needle [, int $offset = 0 ] )
返回在字符串 haystack 中 needle 首次出現的數字位置。 注意如果字符串中有多字節字符則要使用mb_stripos。
2.strpos — 查找字符串首次出現的位置
int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )
返回 needle 在 haystack 中首次出現的數字位置。
3.strstr — 查找字符串的首次出現
string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] )
返回 haystack 字符串從 needle 第一次出現的位置開始到 haystack 結尾的字符串。
4.strrchr — 查找指定字符在字符串中的最后一次出現
string strrchr ( string $haystack , mixed $needle )
該函數返回 haystack 字符串中的一部分,這部分以 needle 的最后出現位置開始,直到 haystack 末尾。
5.strripos — 計算指定字符串在目標字符串中最后一次出現的位置(不區分大小寫)
int strripos ( string $haystack , string $needle [, int $offset = 0 ] )
以不區分大小寫的方式查找指定字符串在目標字符串中最后一次出現的位置。與 strrpos() 不同,strripos() 不區分大小寫。 注意如果字符串中有多字節字符則要使用mb_strripos。
6.strrpos — 計算指定字符串在目標字符串中最后一次出現的位置
int strrpos ( string $haystack , string $needle [, int $offset = 0 ] )
返回字符串 haystack 中 needle 最后一次出現的數字位置。注意 PHP4 中,needle 只能為單個字符。如果 needle 被指定為一個字符串,那么將僅使用第一個字符。
7.substr_count — 計算字串出現的次數
int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] )
substr_count() 返回子字符串needle 在字符串 haystack 中出現的次數。注意 needle 區分大小寫。