Please I have this string :
$s = "Cannes (06150-06400), Limoges (87000-87100-87280), 06000, Paris";
I want to store only words in an array, so I tried this :
$villes = explode(',', preg_replace('#\(([0-9\-]*)\)#', '', $s));
But in result I get this array :
array(4) {
[0]=>
string(7) "Cannes "
[1]=>
string(9) " Limoges "
[2]=>
string(7) " 06000" // This shouldn't be displayed in the array
[3]=>
string(6) " Paris"
}
Please how could I modify the regex to get it work as I wish. Thanks.
str_word_count($string, 1)?