if I wanna count the number of slashes in a url ??
I yeaaa it sound funny why anyone would want to do that...but some function I got requires it.
how can I count the number of times a particular characher occurs in a given string ?
I tried using preg_match, and ereg, but they work only if the character repeats itself as in aaaaa, but not as in asacaval
well, here's my code...
print("<BR> number of slashes.. ");
print ereg("/", $REDIRECT_URL, $array);
the output for. eg. is...
number of slashes.. 1
I thought there were three of them in this string.
Maybe I'm using the wrong function altogether.