mb_substr_count

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

mb_substr_count统锟斤拷锟街凤拷锟斤拷锟斤拷锟街的达拷锟斤拷

说锟斤拷

mb_substr_count ( string $haystack , string $needle [, string $encoding = mb_internal_encoding() ] ) : int

统锟斤拷锟斤拷锟街凤拷锟斤拷 needle 锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷 haystack 锟叫的达拷锟斤拷锟斤拷

锟斤拷锟斤拷

haystack

要锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷

needle

锟斤拷锟斤拷锟揭碉拷锟街凤拷锟斤拷锟斤拷

encoding

encoding 锟斤拷锟斤拷为锟街凤拷锟斤拷锟诫。锟斤拷锟绞★拷裕锟斤拷锟绞癸拷锟斤拷诓锟斤拷址锟斤拷锟斤拷搿�

锟斤拷锟斤拷值

锟斤拷锟街凤拷锟斤拷 needle 锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷 haystack 锟叫的达拷锟斤拷锟斤拷

锟斤拷锟斤拷

Example #1 mb_substr_count() 锟斤拷锟斤拷

<?php
echo mb_substr_count("This is a test""is"); // 锟斤拷锟� 2
?>

锟轿硷拷

  • mb_strpos() - 锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟街凤拷锟斤拷锟斤拷锟阶次筹拷锟街碉拷位锟斤拷
  • mb_substr() - 锟斤拷取锟斤拷锟斤拷锟街凤拷锟斤拷
  • substr_count() - 锟斤拷锟斤拷锟街达拷锟斤拷锟街的达拷锟斤拷