Description :
Retourne un tableau avec les mots, dans l'ordre de la chaine.
Portion de code
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<? function split_words($string){ $retour = array(); $delimiteurs = ' .!?, :;(){}[]%'; $tok = strtok($string, " "); while (strlen(join(" ", $retour)) != strlen($string)) { array_push($retour, $tok); $tok = strtok ($delimiteurs); } return array_non_empty($retour); }
?> |
|