<?php . . . ?> You usually surround a PHP script with the markup <?php...?>, which tells a PHP-enabled server that you're going to be using PHP. A number of keywords, which appear in Table A-1, are reserved for PHP's own use.
Scripts are composed of PHP statements, which end with a semicolon in PHP, unless they're compound statements surrounded with curly braces, { and } . Here's an example of both: <?php if ($test) { echo "No worries."; } ?> You can also interleave PHP with HTML; here's an example: <?php if ($test) { ?> <b>No worries.</b> <?php } else { ?> <b>Could be a problem.</b> <?php } ?> |