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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment