substr_count()

It counts the number of substring occurrences

Example

<?php
echo substr_count(“phpcode. phpcodez”,”code”);
?>

Output

2

Share