Some php files in the framework have no '?>' closing tag but have <?php opening tag.
When is it appropriate or required to add the closing tag?
One of many examples in the blog demo:
../protected/components/TagCloud.php
Kindly explain this convention!
Page 1 of 1
[SOLVED] Why no PHP closing tag? curious. many files in the sample code are missing ?> tag
#2
Posted 07 October 2011 - 03:33 PM
Omitting closing ?> tag in files that contain only PHP code is considered a good practice.
As stated in http://framework.zen...formatting.html:
As stated in http://framework.zen...formatting.html:
Quote
It is not required by PHP, and omitting it prevents the accidental injection of trailing white space into the response.
#3
Posted 19 November 2012 - 11:44 AM
Dear friends.
I have a problem, because all my php files in the framework have no '?>' closing tag. However I can't see any php page.
I uploaded to server host with this characteristics:
PHP Version 5.2.14
.
.
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
.
.
serialize_precision 100 100
short_open_tag Off Off
.
.
.
Adding ?> tag solves the problem, but I have many php pages
Any suggestions are welcome
thank u.
Oswaldo
I have a problem, because all my php files in the framework have no '?>' closing tag. However I can't see any php page.
I uploaded to server host with this characteristics:
PHP Version 5.2.14
.
.
report_zend_debug On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
.
.
serialize_precision 100 100
short_open_tag Off Off
.
.
.
Adding ?> tag solves the problem, but I have many php pages
Any suggestions are welcome
thank u.
Oswaldo
Share this topic:
Page 1 of 1

Help












