Jump to content

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


wisewood

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.



SOLVED.

Engaged my brain and used the substr_count() function.

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.