Blogger Information
Blog 5
fans 0
comment 0
visits 5036
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP中的字符串连接运算符
phpcn_u10161的博客
Original
2085 people have browsed it

字符串连接运算符是为了将两个字符串进行连接,PHP中提供的字符串连接运算符有:

(1)连接运算符(“.”):它返回将右参数附加到左参数后面所得的字符串。

(2)连接赋值运算符(“.=”):它将右边参数附加到左边的参数后。


[html] view plain copy

<?php  

$a  =  "Hello " ;  

 $b  =  $a  .  "World!" ;  // now $b contains "Hello World!"  

  

 $a  =  "Hello " ;  

 $a  .=  "World!" ;      // now $a contains "Hello World!"  

 ?> <?php  

$a  =  "Hello " ;  

 $b  =  $a  .  "World!" ;  // now $b contains "Hello World!"  

  

 $a  =  "Hello " ;  

 $a  .=  "World!" ;      // now $a contains "Hello World!"  

 ?>   



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post