Possible Duplicate:
why in some scripts they omit the closing php tag ?>
As explained in the Code Igniter style guide, it seems that PHP closing tags are optional. It even say you should avoid it for several reasons.
Anyone would have some more information about this issue ?
Thanks !
If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file.
php and ?>. These are called PHP's opening and closing tags. Statements witihn these two are interpreted by the parser. PHP script within these tags can be embedded in HTML document, so that embedded code is executed on server, leaving rest of the document to be processed by client browser's HTML parser.
Note: PHP statements end with a semicolon ( ; ).
One reason people avoid the closing ?> tag is avoid "the headers already sent error" due to line breaks or other invisible characters after the ?> tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With