Blogger Information
Blog 46
fans 0
comment 0
visits 34397
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php中.=什么意思
上草一方
Original
1821 people have browsed it

php中“.=”表示赋值运算符,是字符串连接的意思,该运算符的使用语法如“$string .=
string2;”,可以实现字符串拼接效果。

当变量$a的值为 a 时

执行$a .= ‘bc’

结果为$a = ‘abc’

当变量$a的值为 x 时

执行$a .= ‘bc’

结果为$a = ‘xbc’

  1. <?php
  2. $a = 'a';
  3. $a .= 'bc';
  4. // 相当于 $a='a'.'bc';
  5. // $a = 'abc';
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