array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mb-stristr.php', 1 => 'mb_stristr', ), 'up' => array ( 0 => 'ref.mbstring.php', 1 => '多字节字符串 函数', ), 'prev' => array ( 0 => 'function.mb-stripos.php', 1 => 'mb_stripos', ), 'next' => array ( 0 => 'function.mb-strlen.php', 1 => 'mb_strlen', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mbstring/functions/mb-stristr.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_stristr — 大小写不敏感地查找字符串在另一个字符串里的首次出现
$haystack
,$needle
,$before_needle
= false
,$encoding
= null
mb_strstr() 查找了 needle
在 haystack
中首次的出现并返回 haystack
的一部分。
和 mb_strstr() 不同的是,mb_stristr() 是大小写不敏感的。
如果 needle
没有找到,它将返回 false
。
返回 haystack
的一部分,或者 needle
没找到则返回 false
。
版本 | 说明 |
---|---|
8.0.0 |
现在 needle 接受空字符串。
|
8.0.0 |
现在 encoding 可以为 null。
|