Home  >  Article  >  Backend Development  >  php string operators

php string operators

伊谢尔伦
伊谢尔伦Original
2016-11-24 13:25:241543browse

There are two string operators. The first is the concatenation operator ("."), which returns the concatenated string of its left and right arguments. The second is the concatenation assignment operator (".="), which appends the right argument to the left argument. See Assignment Operators for more information.

<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php type operatorNext article:php type operator