PHP Weekly

PHP closing tags….Don’t need them, so don’t use them. At least in files that have nothing but PHP code in them.  Here’s a quote from the Zend Programmers Guide:“For files that contain only PHP code, the closing tag (”?>”) is never permitted. It is not required by PHP, and omitting it prevents the accidental injection of trailing whitespace into the response.” Have you even gotten that “headers already sent” error? Since this is often caused by trailing white space in your include files, leaving off the closing tag will prevent that form happening.Thanks all for now. 

Tags:

This entry was posted on Saturday, August 23rd, 2008 at 12:03 am and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

 

Leave a Reply