shadowline
Numbers - Random << Strings - Connecting >> Strings - Pulling apart
Connecting strings together is known as concatenation. The operator to use with this is the period.

$NewString = $string1 . $string2;

The value of $NewString is the combination of $string1 and $string2. This is not addition like in math. This is taking the value of $string2 and plunking it onto the end of $string1.

<?php
$string1 = "This is an example";
$string2 = "of connecting strings.";
$NewString = $string1 . $string2;
echo "$NewString";
?>

This is an exampleof connecting strings.

Hmmm... that doesn't quite look right. There should be a space between the words example and of. Let's add in a space on the connecting code line :

$NewString = $string1 . " " . $string2;

This is an example of connecting strings.

So you can add strings, direct quoted data, and so forth together. Some "real world" example of using this may be to combine a $FirstName and $LastName into one string. There could be many other uses as well.
Numbers - Random << Strings - Connecting >> Strings - Pulling apart
shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow