oim 1453
| Posté : 27-09-2004 10:37
Comme ca c pas bon, c quoi qui ne vas pas ?
<?PHP
if(!isset($mainfile)) { !include!("mainfile.php"); }
global $pdst; $pdst="1";
!include!("header.php");
function img_extractor_string($chaine){
$retour = array();
while($x = stristr($chaine, "<img")){
$image = substr($x, 4, strpos($x, ">")-4);
#print "n";
$chaine = substr($x, strpos($x, ">"));
preg_match_all("/b([^s]+)s*=s*("|')(.*?)("|')s/", " $image ", $attribut);
$details = arrays2hash($attribut[1], $attribut[3]);
$details['tag'] = $image;
$image2 = preg_replace("/b([^s]+)s*=s*("|')([s]*?)("|')s/", "", " $image ");
preg_match_all("/b([^s]+)s*=s*([^s]*?)s/", " $image2 ", $attribut);
// l'ordre du merge est important : on ecrase les valeurs
trouvees sans guillemets
// par celle trouvee avec.
$details = array_merge( arrays2hash($attribut[1], $attribut[2]), $details);
array_push($retour, $details);
}
return $retour;
}
OpenTable();
echo "<TABLE WIDTH=100% CELLSPACING=2 CELLPADDING=2 BORDER=0><TR><TD CLASS=\"HEADER\">\n";
$result=mysql_query("select content from seccont where seci d='10' ");
list($content) = mysql_fetch_row($result);
$imgs = img_extractor_string($content)
echo "<tr><TD CLASS=\"HEADER\">print_r($imgs);</td></tr>";
echo "</TD></TR></TABLE>\n";
CloseTable();
!include!("footer.php");
?>
|