I just want to count the number of characters in a string...
Ie,
this.is.an.example
in this string, I want to count how many periods are in it...
how would I do this?
I just want to count the number of characters in a string...
Ie,
this.is.an.example
in this string, I want to count how many periods are in it...
how would I do this?
There's [man]substr_count/man.
... Which could have been found by going to the manual at http://www.php.net/ and searching for "count characters". Funnily enough, even though "count characters" isn't a function name, it's close enough to "count_chars" for the function name search to be correct on the first hit, so it's not even necessary to widen the search to the rest of the manual.
Incidentally, the title of the thread doesn't match the question. E.g., in the example string "this.is.an.example" there are three '.' characters but 12 unique characters.