PHP Concatenation
We can display our variables in a meaningful fashion with the use of concatenation. Concatenation makes use of the period (.). Please see the example below which is an example of affixing a value to the end of the variable:
<?php $name = “Marc”; $name .= “Fraser”; ?>
Basically what ‘.=’ is doing is saying use the current value of $name and add “Fraser” to the end of it. If I were to now print $name, it would output “MarcFraser”.
We can also use concatenation to create readable sentences:
<?php $name = “ Marc Fraser”; $age = 16; print “We would like to welcome you,” . $name . “, age” . $age . “ to our website!”; ?>
This will output “We would like to welcome you, Marc Fraser, age 16 to our website!”. To do this, we close the string (close quotation mark) and add our period, which tells the server that we wish to begin parsing PHP again. When we want to stop parsing PHP we add a period and then begin our string again (quotation mark).
November 19th, 2009 - 12:12
Z5UW2I klcvqeutrxwc, [url=http://nekkphncagei.com/]nekkphncagei[/url], [link=http://ixfteplmwrrg.com/]ixfteplmwrrg[/link], http://wkcernaqjxol.com/