<?php
for($i =0;$i< 3;$i++){
echo "<td align=\"center" width =50 height =50"\"><img src =\"";
echo $pictures[$i];
echo "\"/></td>";
}
?>
for($i =0;$i< 3;$i++){
echo "<td align=\"center" width =50 height =50"\"><img src =\"";
echo $pictures[$i];
echo "\"/></td>";
}
?>
<?php
for($i =0;$i< 3;$i++)
{
echo '<td align="center" width =50 height =50><img src =" ';
echo $pictures[$i];
echo " '></td>';
}
?>
可以试试看。
<?php
for($i =0;$i< 3;$i++){
echo "<td align=\"center\" width =50 height =50\"><img src =\"";
echo $pictures[$i];
echo "\" /></td>";
}
?>
for($i =0;$i< 3;$i++){ ?>
<td align="center width="50" height="50"><img src="<?php echo $pictures[$i]; ?>" /></td>
<?php
}
?>
可以这样写,比较清晰
for($i=0;$i<3;$i++){ ?>
<td align="center" width="50" height="50"><img src="<?php echo $pictures[$i]; ?>" /></td>
<?php
}
?>
4楼漏了个引号~
for($i =0;$i< 3;$i++)
{
echo "<td align='center' width=50 height=50><img src = '".$pictures[$i]."'></td>";
}
for($i =0;$i< 3;$i++){
echo <<<EOB<td align="center width="50" height="50"><img src="<?php echo $pictures[$i]; ?>" /></td>EOB;
}
?>
{
echo "<td align='center' width=50 height=50><img src='{$pictures[$i]}'></td>";
}
for($i =0;$i< 3;$i++) {
echo '<td align="center" width="50" height="50"><img src = "',$pictures[$i],'"></td>';
echo '<td align="center" width="50" height="50"><img src = "{$pictures[$i]}"></td>';
echo "<td align=\"center\" width=\"50\" height=\"50\"><img src = \"",$pictures[$i],"\"></td>';
echo "<td align=\"center\" width=\"50\" height=\"50\"><img src = \"{$pictures[$i]}\"></td>';
//N多种写法……
}
for($i =0;$i< 3;$i++)
echo "<td align='center' width ='50' height ='50'><img src ='$pictures[$i]' /></td>";
?>
echo "<td align=\"center\" width=\"50\" height=\"50\"><img src = \"",$pictures[$i],"\"></td>';
align=后面要加一个反斜杠啊,
还有:echo "<td align='center' width ='50' height ='50'><img src ='$pictures[$i]' /></td>";
为什么,'$pictures[$i]' ,这么写呢?
能不能把这些写法的原则告诉我啊,我老是不会写,什么情况下用单引号,什么情况下用双引号。
for($i =0;$i< 3;$i++){
echo '<td align="center" width =50 height =50><img src ="';
echo $pictures[$i];
echo '"></td>';
}
?> 我感觉这样可以....