never mind .. I figured it out. not sure how pretty it is .. but it works.
So, for anyone else struggling with this .....
The pattern is to add a space after the last str_replace('foo', '', then repeat that
str_replace('foo', '',
and don't forget to add another curved bracket after $string
The code previously posted to not charge for the "period" was:
Code:
$letters_count = strlen(str_replace(' ', '', str_replace('.', '', $string)));
to allow ' " . , - / ( ) % # I changed it to:
Code:
$letters_count = strlen(str_replace(' ', '', str_replace('.', '', str_replace(',', '', str_replace("'", '', str_replace('-', '', str_replace('/', '', str_replace('"', '', str_replace('(', '', str_replace(')', '', str_replace('%', '', str_replace('#', '', $string))))))))))));
BTW single quote was a problem, I eventually solved by putting it in double quotes
If anyone knows a better way to do any of this ... let me know.
steco
( I don't even play a programmer on TV)