PHP Start and End Tags (Chapter 4)

Main Lab 4 Page


There are three different methods one can use to encapsulate PHP code in what is otherwise an HTML document.

Opening Tag Closing Tag
<?php ?>
<? ?>
<script language="php"> </script>

All three of these methods are super effective. However the use of the second method (also known as a short open tag) is generally frowned upon as it may create conflict with other server-side scripting languages which may use the same method. Because of that, this server disables the use of the short open tag.

Nonetheless, here are all three methods demonstrated:

This is a test using the first tag type.

This is a test using the second tag type.

"; ?>