PHP Tags

The PHP code in the preceding example began with . This is similar to all HTML tags because they all begin with a less than () symbol. These symbols () are called PHP tags. They tell the web server where the PHP code starts and finishes. Any text between the tags is interpreted as PHP. Any text outside these tags is treated as normal HTML. The PHP tags allow you to escape from HTML

There are actually two styles of PHP tags; each of the following fragments of code is equivalent

  • XML style
<?php echo '<p>Order processed.</p>'; ?>
  • Short style
<? echo '<p>Order processed.</p>'; ?>

Leave a Comment