Home > Backend Development > PHP Problem > php .= what does it mean

php .= what does it mean

Guanhui
Release: 2023-02-28 22:04:01
Original
9183 people have browsed it

php .= what does it mean

php .=What does it mean

In PHP, the .= symbol is called the connection assignment operator and is used to connect two or multiple strings, and it is different from the "." connection operator in that it splices the right parameter to the left parameter and assigns it to the left parameter.

String operators

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.

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

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>
Copy after login

The above is the detailed content of php .= what does it mean. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template