echo "<td align="center"><img src="";
1. " "
2.
echo <<<theEnd line 1 line 2 line e theEnd
实例
随机三张图片(banner)
1 <?php 2 $pictures = array('tire.jpg', 'oil.jpg', 'spark_plug.jpg', 3 'door.jpg', 'steering_wheel.jpg', 4 'thermostat.jpg', 'wiper_blade.jpg', 5 'gasket.jpg', 'brake_pad.jpg'); 6 7 shuffle($pictures); 8 ?> 9 <html>10 <head>11 <title>Bob's Auto Parts</title>12 </head>13 <body>14 15 <h1>Bob's Auto Parts</h1>16 <div align="center">17 <table width = 100%>18 <tr>19 20 <?php21 for ($i = 0; $i < 3; $i++) {22 echo "<td align="center"><img src="";23 echo $pictures[$i];24 echo ""/></td>";25 }26 ?>27 </tr>28 </table>29 </div>30 </body>31 </html>