Maison > développement back-end > tutoriel php > php echo字符串的连接格式,phpecho字符串格式_PHP教程

php echo字符串的连接格式,phpecho字符串格式_PHP教程

WBOY
Libérer: 2016-07-12 08:57:52
original
1142 Les gens l'ont consulté

php echo字符串的连接格式,phpecho字符串格式

<span>echo</span> "<td align=<span>\"</span>center<span>\"</span>><img  src=\"";</pre alt="php echo字符串的连接格式,phpecho字符串格式_PHP教程" >

<p><strong><span><span>1.</span>  \"    \"</span></strong></p>
<p><span>2.  </span></p>

<pre class="code"><span>echo</span> <<<<span>theEnd
        line </span>1<span>
        line </span>2<span>
        line e
    theEnd</span>
Copier après la connexion

实例

随机三张图片(banner)

<span> 1</span> <?<span>php
</span><span> 2</span>   <span>$pictures</span> = <span>array</span>('tire.jpg', 'oil.jpg', 'spark_plug.jpg',
<span> 3</span>                     'door.jpg', 'steering_wheel.jpg',
<span> 4</span>                     'thermostat.jpg', 'wiper_blade.jpg',
<span> 5</span>                     'gasket.jpg', 'brake_pad.jpg'<span>);
</span><span> 6</span> 
<span> 7</span>   <span>shuffle</span>(<span>$pictures</span><span>);
</span><span> 8</span> ?>
<span> 9</span> <html>
<span>10</span> <head>
<span>11</span>   <title>Bob'<span>s Auto Parts</title>
</span><span>12</span> <span></head>
</span><span>13</span> <span><body>
</span><span>14</span> 
<span>15</span> <h1>Bob's Auto Parts</h1>
<span>16</span> <div align="center">
<span>17</span> <table width = 100%>
<span>18</span> <tr>
<span>19</span> 
<span>20</span> <?<span>php
</span><span>21</span>   <span>for</span> (<span>$i</span> = 0; <span>$i</span> < 3; <span>$i</span>++<span>) {
</span><span>22</span>     <span>echo</span> "<td align=\"center\"><img  src=\""<span alt="php echo字符串的连接格式,phpecho字符串格式_PHP教程" >;
</span><span>23</span>     <span>echo</span> <span>$pictures</span>[<span>$i</span><span>];
</span><span>24</span>     <span>echo</span> "\"/></td>"<span>;
</span><span>25</span> <span>  }
</span><span>26</span> ?>
<span>27</span> </tr>
<span>28</span> </table>
<span>29</span> </div>
<span>30</span> </body>
<span>31</span> </html>
Copier après la connexion

 

 

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1106390.htmlTechArticlephp echo字符串的连接格式,phpecho字符串格式 echo "td align= \" center \" img src=\""; 1. \" \" 2. echo theEnd line 1 line 2 line e theEnd 实例 随机三张图片(ba...
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal