When PHP analyzes a file, it looks for the opening and closing tags, which are <?php y ?>
, and that tell PHP where to start and end the interpretation of the code. This mechanism allows PHP to be embedded in all types of documents, since everything outside the PHP opening and closing tags will be ignored by the analyzer.
PHP also allows the abbreviated opening tag <?
(which is inadvisable because it is only available if enabled with the short_open_tag directive from the php.ini
configuration file, or if PHP was configured with the --enable-short-tags
option %).
Here I leave the full information:
PHP tags