substr_count

substr_count -- Telt het aantal substrings in een string

Beschrijving

int substr_count ( string haystrack, string needle)

substr_count( ) geeft het aantal keren dat de needle substring voorkomt in haystack .

Voorbeeld 1 . substr_count( ) voorbeeld

 
?php

 
print

 
substr_count(

 
"This

 
is

 
a

 
test"

 
,

 
"is"

 
;)

 
;

 
/

 
/

 
geeft

 
2

 
?





Zie ook count_chars( ) , strpos( ) , substr( ) en strstr( ) .