Page 1 of 1

how to find the number of occurrances of a string?

Posted: Thu Nov 17, 2005 5:31 am
by jasongr
Hello

I have some very long text
I need to count the number of times the phrase 'Num photos'
appears in the global text (stored in variable $content)

Is there an efficient way to do this without resorting to parsing?

regards

Posted: Thu Nov 17, 2005 5:52 am
by n00b Saibot
try substr_count() for your problem...

Posted: Thu Nov 17, 2005 5:53 am
by jasongr
thanks for the help n00b Saibot

I am facing a generic parsing problem.
maybe you can help me at viewtopic.php?t=40874