php echo字符串的连接格式
2016-03-07 15:33
453 查看
echo "<td align=\"center\"><img src=\"";
1. \" \"
2.
echo <<<theEnd line 1 line 2 line e theEnd
实例
随机三张图片(banner)
<?php $pictures = array('tire.jpg', 'oil.jpg', 'spark_plug.jpg', 'door.jpg', 'steering_wheel.jpg', 'thermostat.jpg', 'wiper_blade.jpg', 'gasket.jpg', 'brake_pad.jpg'); shuffle($pictures); ?> <html> <head> <title>Bob's Auto Parts</title> </head> <body> <h1>Bob's Auto Parts</h1> <div align="center"> <table width = 100%> <tr> <?php for ($i = 0; $i < 3; $i++) { echo "<td align=\"center\"><img src=\""; echo $pictures[$i]; echo "\"/></td>"; } ?> </tr> </table> </div> </body> </html>
相关文章推荐
- 在smarty中通过php脚本获取smarty变量
- PHP转换IP地址到真实地址的方法详解
- PHP常用函数收藏
- php can't connect to mysql with error 13
- PHP如何取出数组最后一个元素?
- 检测PHP环境
- Windows下的PHP安装文件线程安全和非线程安全的区别
- Laravel 5.1学习之 验证
- php 简洁上传
- php 的定界符 <<<eof 的问题
- 【PHP】PHP 7.0.4 发布
- ContentProvider的生命周期
- PHP - 继承 - 子类使用父类方法
- Matplotlib Tutorial(译)
- 搜索实现最近联系人 thinkPHP框架
- Zend Framework教程之MVC框架的Controller用法分析
- Zend Framework教程之路由功能Zend_Controller_Router详解
- 关于PHP的框架
- php session
- php中mkdir()函数的权限问题