If you do (accidentally) leave out a newline character after the closing php tag ( '?>' ) then you may see 'Headers Already Sent' errors. So if you are seeing this error in your output, double check the php file for newline characters after the closing tag.
akshay dot leadindia at gmail dot com ¶
1 year ago
preda dot vlad at yahoo dot com ¶
1 month ago
So here are the valid ways to open PHP tags:
<?php ?> // standard tags
<? ?> // short tags, need short_open_tag enabled in php.ini
<% %> // asp tags, need asp_tags enabled in php.ini
<script language="php"> </script> // case insensitive
PSR-1 coding standards suggest to only use <?php ?> or <?= ?> (echo short tags) - and no other variations, and PSR-2 suggests to not close the tags in PHP only files.
