Everything outside of a pair of opening and closing tags is ignored by the PHP parser which allows PHP files to have mixed content. This allows PHP to be embedded in HTML documents, for example to create templates.
Using structures with conditions
Example #1 Advanced escaping using conditions
For outputting large blocks of text, dropping out of PHP parsing mode is generally more efficient than sending all of the text through echo or print.
Note:
If PHP is embeded within XML or XHTML the normal PHP
<?php ?>
must be used to remain compliant with the standards.
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/language.basic-syntax.phpmode.php