文字

mb_stripos

(PHP 5 >= 5.2.0)

mb_stripos大小写不敏感地查找字符串在另一个字符串中首次出现的位置

说明

int mb_stripos ( string $haystack , string $needle [, int $offset = 0 [, string $encoding = mb_internal_encoding() ]] )

mb_stripos() 返回 needle 在字符串 haystack 中首次出现位置的数值。 和 mb_strpos() 不同的是, mb_stripos() 是大小写不敏感的。 如果 needle 没找到,它将返回 FALSE

参数

haystack

在这个字符串中查找获取 needle 首次出现的位置

needle

haystack 中查找这个字符串

offset

haystack 里开始搜索的位置

encoding

使用的字符编码名称。 如果省略了它,将使用内部字符编码。

返回值

返回字符串 haystackneedle 首次出现位置的数值。 如果没有找到 needle,它将返回 FALSE

参见

  • stripos() - 查找字符串首次出现的位置(不区分大小写)
  • strpos() - 查找字符串首次出现的位置
  • mb_strpos() - 查找字符串在另一个字符串中首次出现的位置

用户评论:

[#1] gtso2009-lbc at NOSPAM dot yahoo dot fr [2013-09-12 15:22:44]

If you are using a php version < 5.2.0 AND do not really need case insensitive performing, use mb_strpos instead.
mb_strpos is implemented for PHP 4 >= 4.0.6 and PHP 5

上一篇: 下一篇: