misc.php

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Miscellany</title></head>
<body>
<p>
<?php
// + is not string concatenation, it is only addition
print '"foo" + "bar"='; print "foo" + "bar";
print "<br/>\n";
print '"foo" . "bar"='; print "foo" . "bar";
print "<br/>\n";
// Strings do convert to numbers if possible.  In JavaScript this would be "34".
print '"3" + "4"='; print "3" + "4";
print "<br/>\n";

// variables and escapes are expanded inside "" but not ''
$x = 'Joe';
print "Hello, $x!";
print "<br/>\n";
print 'Hello, $x!';
print '<br/>\n';

// strings may span multiple lines
$str1 = "Line 1
         Line 2";
print "$str1<br/>\n";
?>
</p>
</body>
</html>