Hey guys! I got a variable which holds a phrase...What I gotta do is to count how many <\ul> I have on this phrase (it's a html line code)... Please help me! I couldn't figure out how to do that! Thanx in advance
Felipe Lopes
use the function strpos()
something like
$content = fread($fp, filesize($file)); $current_pos = 0;
while ($current_pos = strpos($content, "</ul>", $current_pos) {
$number_of_ul++; }
Think this should work ? Just wrote it here on the fly...
Sorry but I didn't understand how your code works :-(...Could you explain for me "what's going on"??
Okay, I got it :-)) Thank you very much... will try it out now
Manuals are your friend: http://www.php.net/manual/en/function.substr-count.php
Dominique
damned, didn't know about that one either. again it's proven that answering questions might learn yourself something too 🙂