PHP-manual:
<?php
/ Assigning a string. /
$str = "This is a string";
/ Appending to it. /
$str = $str . " with some more text";
/ Another way to append, includes an escaped newline. /
$str .= " and a newline at the end.\n";
/ This string will end up being '<p>Number: 9</p>' /
$num = 9;
$str = "<p>Number: $num</p>";
/ This one will be '<p>Number: $num</p>' /
$num = 9;
$str = '<p>Number: $num</p>';
/ Get the first character of a string /
$str = 'This is a test.';
$first = $str{0};
/ Get the last character of a string. /
$str = 'This is still a test.';
$last = $str{strlen($str)-1};
?>