note 23884 deleted from function.count-chars by didou

From: Date: Mon, 20 Oct 2003 11:56:49 +0000
Subject: note 23884 deleted from function.count-chars by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58937@lists.php.net to get a copy of this message
Note Submitter: carl.corliss@postnuke.com ---- I might even suggest adding this line: $var = eregi_replace(" +", " ", $string); to make any instance of multiple spaces into one space... that should help somewhat... function count_words($string) { // below line added to make contiguous spaces count as one space $string = eregi_replace(" +", " ", $string); $result = count_chars($string, 0); return(round($result[32], -1)); } Note: I haven't tested this but, I believe it should work... :)

« previous php.notes (#58937) next »