une ptit soucis, j'aimerai rajouter dans cette fonction:
<img class="XXX" .... et pouvoir ressortir comme ca $class = $matches[XX][$i];
dans le traitement suivant :
CODE
$reg = "/<img src='IMG\/([^']+)' ?([^ ]+) width=[^ ]+ ?([^ ]+) height=[^ ]+ ([^>]+)>/";
preg_match_all ($reg, $string, $matches);
$to_return = $string;
for ($i=0; $i< count($matches[0]); $i++) {
$img = $matches[1][$i];
$bef = $matches[2][$i];
$aft = $matches[4][$i];
$btw = $matches[3][$i];
....
preg_match_all ($reg, $string, $matches);
$to_return = $string;
for ($i=0; $i< count($matches[0]); $i++) {
$img = $matches[1][$i];
$bef = $matches[2][$i];
$aft = $matches[4][$i];
$btw = $matches[3][$i];
....
pour pouvoir le ressortir ici .....img class= ".$class."......
CODE
$to_return = preg_replace("<".$matches[0][$i].">",
$before."<img src='IMG/".$img."' ".$size." ".$bef." ".$btw." ".$aft." >".$after,
$before."<img src='IMG/".$img."' ".$size." ".$bef." ".$btw." ".$aft." >".$after,
J'espere que je suis clair?? moi et les expressions regulieres :yoot: