什么。= PHP中的意思? [重复]

This question already has an answer here:

What is the difference between .= and = ? What is .= used for?

Example:

<?php
$file = fopen('WERK-tabelle.csv', 'r') or die('error');

$yml = '';
$keys = [
    blabla, code, php
];

while (($values = fgetcsv($file, 0, ';')) !== FALSE) {
    $yml .= "<br>";
    $arr = array_combine($keys, $values);
    foreach ($arr as $key => $value) {
        $yml .= "<br>{$key}{$value}
";
    }
}
</div>

.= is simply used to add something to the end of a string, without overwriting it.

Example 1 (without .=):

$myvar = "Hello";
$myvar = "Peter";
echo $myvar; //Will output "Peter"

Example 2 (With .=):

$myvar = "Hello";
$myvar .= "Peter";
echo $myvar; //Will output "HelloPeter" (concatenated string)