Jump to content


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


***SOLVED*** Count the instances of a string within a string

Recommended Posts

I have a string, which for example, might be this;

$string = "The quick brown fox jumped over the lazy dog";

I want a way to count, for example, how many times the letter "o" appears in that string.

Can someone nidge me in the right direction... my brain isnt working today.


Engaged my brain and used the substr_count() function.

Share this post

Link to post
Share on other sites


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.