我在PHP中有一个投影函数。
在我的php页面中,我的HTML设置如下:
<img src="<?php echo drpShadow($img_path[$i]);?>" />php函数如下:
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;
}这个函数不会被调用,因为回声"hello“没有出现。
我该如何解决这个问题?
谢谢
发布于 2009-11-28 06:24:15
因为你要把函数输出放到src标签中?你会得到类似这样的东西:
img src=“你好表格边框...”
查看页面源代码,您应该会在那里看到hello ;)
https://stackoverflow.com/questions/1810812
复制相似问题