PHP closing tag
Posted: Tue Jun 26, 2012 4:18 pm
Started messing around with CodeIgniter and was looking through some docs on their site. Ran across this:
http://codeigniter.com/user_guide/gener ... losing_tag

http://codeigniter.com/user_guide/gener ... losing_tag
I'd never heard of this before... passing it along since I know there are a lot of PHP users herePHP Closing Tag
The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. This allows you to still identify a file as being complete and not truncated.
INCORRECT:CORRECT:Code: Select all
<?php echo "Here's my code!"; ?>Code: Select all
<?php echo "Here's my code!"; /* End of file myfile.php */ /* Location: ./system/modules/mymodule/myfile.php */