Jump to content

String Occourance Funtion...


Moptop650

Recommended Posts

Is there a function (or combination of functions) that would count the number of occurrences of a string in another string?

 

Example:

 

$words="Blah blah allah";

$occurrences=thatfuncton($words, "a");

echo $occurrences;

 

 

Which would echo '4' because 'a' appears in $words 4 times.

Link to comment
https://forums.phpfreaks.com/topic/37691-string-occourance-funtion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.