J'ai une fonction d'ombre portée en PHP.Fonction php echo en HTML, ça marche?
Dans ma page php, j'ai HTML mis en place comme ceci:
<img src="<?php echo drpShadow($img_path[$i]);?>" />
La fonction php est comme ceci:
function drpShadow($pic_url){ echo "Hello";
list($width, $height)=getimagesize($pic_url);
$pic_display="<table border='0' style='display:inline;' cellspacing='0' cellpadding='0'><tr><td width='4px' height='$height'><img src='/SV/Graphics/drop_shadow_top_left_corner_4x4.jpg'><br>";
for ($i=0; $i<($height-4); $i++){
$pic_display.="<img src='/SV/Graphics/drop_shadow_left_4x1.jpg'><br>";
}
$pic_display.="</td><td width='$width' height='$height'><img src='$pic_url'></td></tr><tr><td colspan='2' height='4px' width='($width+4)'><img src='/SV/Graphics/drop_shadow_left_bottom_corner_4x4.jpg'>";
for ($i=0; $i<=($width-6); $i++){
$pic_display.="<img src='/SV/Graphics/drop_shadow_bottom_1x4.jpg'>";
}
$pic_display.="<img src='/SV/Graphics/drop_shadow_right_bottom_corner_4x4.jpg'></td></tr></table>";
return $pic_display;
}
Cette fonction ne s'appelle pas parce que l'écho « bonjour "ne se présente pas.
Comment dois-je résoudre ce problème?
Merci
Comment le look rendu balise img comme ? –