array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mb-stripos.php', 1 => 'mb_stripos', ), 'up' => array ( 0 => 'ref.mbstring.php', 1 => '多字节字符串 函数', ), 'prev' => array ( 0 => 'function.mb-strimwidth.php', 1 => 'mb_strimwidth', ), 'next' => array ( 0 => 'function.mb-stristr.php', 1 => 'mb_stristr', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mbstring/functions/mb-stripos.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
mb_stripos — 大小写不敏感地查找字符串在另一个字符串中首次出现的位置
mb_stripos() 返回 needle
在字符串 haystack
中首次出现位置的数值。
和 mb_strpos() 不同的是,mb_stripos() 是大小写不敏感的。
如果 needle
没找到,它将返回 false
。
haystack
在这个字符串中查找获取 needle
首次出现的位置
needle
在 haystack
中查找这个字符串
offset
haystack
里开始搜索的位置。如果是负数,就从字符串的尾部开始统计。
encoding
使用的字符编码名称。 如果省略了它,将使用内部字符编码。
返回字符串 haystack
中 needle
首次出现位置的数值。
如果没有找到 needle
,它将返回 false
。
版本 | 说明 |
---|---|
8.0.0 |
现在 needle 接受空字符串。
|
8.0.0 |
现在 encoding 可以为 null。
|
7.1.0 |
支持 offset 使用负数。
|