preda dot vlad at yahoo dot com (2013-03-12 09:14:10)
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.
akshay dot leadindia at gmail dot com (2012-04-01 08:51:49)
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.