Welcome Guest, Not a member yet? Register   Sign In
No PHP end Tag in all files?
#1

[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
#2

[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
#3

[eluser]Jmz[/eluser]
It's not needed.

mironcho explains in this thread
#4

[eluser]n0xie[/eluser]
It's in the user guide.
#5

[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.




Theme © iAndrew 2016 - Forum software by © MyBB