codeigniter rule, for pure php page, not using closing tag. I think this rule is in several other frameworks too.

when I write my own codes, I forced myself not to leave empty space after the closing tag. After a while, I get used to it. And no unwanted empty space in my codes. So I still use the closing tag.

Just not used to the codes without closing tag.

So in your codeigniter coding, what you do? follow the rule "no closing tag" strictly?

    I think I better to follow the no closing tag rule from the beginning in CI coding. Otherwise, it may generate some errors somewhere later on I cannot find where is the extra space coming from.

      I try to be in the habit of leaving out the final ?> in all PHP files (assuming there's no non-PHP output to follow), but especially if it's intended to be any sort of PHP-only include file. That way I don't have to worry about accidentally adding any white-space after the closing tag, any editor (including those used by someone else using the code) automatically adding a newline, or some FTP client doing so.

        2 months later

        I just follow the rule, got used to it from the start.

          Write a Reply...