微信关注,获取新知

strpos()函数

云百科

PHP strpos()函数的作用是什么?实例详解

strpos()函数是PHP编程语言中的一个字符串函数,用于查找子串在字符串中第一次出现的位置。它的作用是返回子串在字符串中的索引位置。 strpos()函数的语法如下: int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) 参数说明: $haystack:要进行查找的原始字...