note 11170 deleted from function.explode by jimw
| From: | jimw@php.net | Date: | Fri, 07 Dec 2001 21:22:33 +0000 |
| Subject: | note 11170 deleted from function.explode by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22000@lists.php.net to get a copy of this message | ||
You want to count the words in a sentence but there are multiple adjacent spaces in it?
I've created a simple code that'll take care of it.
if (eregi(" ", $Entreprise)):
while (eregi(" ", $Entreprise)):
$Entreprise = ereg_replace (" " , " " , $Entreprise);
endwhile;
$Entreprise = explode (" " , $Entreprise);
endif;
Simple huh?