String Operators [#23] Code Dynamic Websites with PHP

Опубликовано: 19 Декабрь 2024
на канале: Brad Hussey
2,687
32

Lecture 23: String Operators

This one's nice and simple: there are only two string operators. The first one is called the concatenation operator ".", which combines the value of the right argument with the left argument. Let's look at it like this:

$a = "Hola ";

$b = $a . "Mi Amigos!";

echo $b; // This prints "Hola Mi Amigos!"

The second operator is the concatenating assignment operator ".=", which appends the value in the right with the value in the left, like this:

$a = "Hola ";

$a .= "Mi Amigos!";

echo $a; // This prints "Hola Mi Amigos!"

The concatenating assignment operator is considered an "Assignment Operator" which we will be learning more about in the next lecture.

DOWNLOAD COURSE FILES HERE
http://www.bradhussey.ca/download-php...