No PHP end Tag in all files? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: No PHP end Tag in all files? (/showthread.php?tid=27452) |
No PHP end Tag in all files? - El Forum - 02-11-2010 [eluser]Unknown[/eluser] Hallo all, i´m new in codeigniter, downloaded the 1.7.2 paket an wonder why all .php files doesent have a ending ?> Tag? In the tutorial Videos i see ending "?>" I downloaded it again an opened it with Windows "Editor", and there are no ?> endings. Is this a carneval joke, or is this my bug? Thanks for help Christian No PHP end Tag in all files? - El Forum - 02-11-2010 [eluser]Bainzy[/eluser] hi, no this is not a bug the codeigniter framework works like this, im not too sure how myself as iv never really thought about it but most examples on the internet dont show the ending ?> tag neither so dont worry, codeigniter will end the files for you, it is good practice however to add this as the last line in your script : Code: # End of file /views/forums.php its just a simple comments stating what folder the file should be in and the name of the file example Code: # End of file /folder/file.php hope this helps No PHP end Tag in all files? - El Forum - 02-11-2010 [eluser]Jmz[/eluser] It's not needed. mironcho explains in this thread No PHP end Tag in all files? - El Forum - 02-11-2010 [eluser]n0xie[/eluser] It's in the user guide. No PHP end Tag in all files? - El Forum - 02-11-2010 [eluser]hccoder[/eluser] "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." Here's the why. |