peda: Punkt nach Variable

Beitrag lesen

hallo!

Bitte bitte einen Link.

ich versuchs dir mal hier zu erklären :)

angenommen, du hast eine variable $hallo mit dem Wert "Hello World". - Die deklaration selbiger sieht so aus:

$hallo = "Hello World";

jetzt wollen wir aus 'Hello World' ein 'Hello World! I am beautiful' machen... daher:

$hallo .= "! I am beautiful";

PHP 'addiert' jetzt, wie Tom vorher erwähnt hat, die beiden strings, nämlich so: "Hello World" + "! I am beautiful" was uns als endgültigen Wert der Variable "Hello World! I am beautiful" liefert.

Das ganze könnte man auch so schreiben. (Übersichtlicher)

$hello = "Hello World!";
$beautiful = "I am beautiful";

$hello .= $beautiful;

...etc.

Der Punkt ist also ein Verkettungsoperator.

Ich bin dumm...

nö, warum? verstehst dus jetzt?

Gruss
 peda