how could i count how many times the character / shows up in a string?
warning: didn't test code... looks like it works though :rolleyes:
<? function occurences_in_string($string,$char) { $counter=0; for ($i=0;$i<count($string);$i++) { if ($string[$i]==$char) { $counter++; } } return $counter; } ?>
Wouldn't the substr_count function do the same thing?
http://us4.php.net/manual/en/function.substr-count.php
yes