Friday, May 21, 2010

PHP..how can I count how many characters are in a word in a paragraph excluding whitespace?

I want to be able to count how many characters are in a word excluding whitespace.

PHP..how can I count how many characters are in a word in a paragraph excluding whitespace?
Remove whitespace and count the length of the resulting string:





$text = "The quick brown fox";


$non_space = preg_replace("/\s+/", "", $text);


$char_count = strlen($non_space);

sim cards

No comments:

Post a Comment