Je n'arrive pas à bien cerner ce que preg_match_all me retourne. Voici le code :
$str="aabcc";
$pattern="/((a+)b?(c+))/";
preg_match_all($pattern,$str,$matches);
print_r($matches[0]);
Je m'attendrais aux retours suivants:
Code : Tout sélectionner
a
aa
c
cc
abc
aabc
abcc
aabbccCode : Tout sélectionner
Array
(
[0] => Array
(
[0] => aabcc
)
[1] => Array
(
[0] => aabcc
)
[2] => Array
(
[0] => aa
)
[3] => Array
(
[0] => cc
)
)Merci!
Patrick