Is it necessary to use closing tag in php?sometime without
closing tag things work.why?

Answer Posted / prashant

This isn't exactly a bug. PHP doesn't require the closing
tag (it is assumed when the file ends). Not specifying the
closing ?> helps prevent accidents like additional
whitespace which will cause session initialization to fail
("headers already sent").

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is python easier than php?

545


Explain the ternary conditional operator in php?

600


Tell me what does the php error 'parse error in php - unexpected t_variable at line x' means?

563


What is if isset ($_ post submit )) in php?

542


What are the two most common ways to start and finish a php block of code?

634






how to detect a mobile device using php

590


What is rtrim php?

548


Is null function in php?

570


What is instantiation?

1744


Why php is better?

539


Is php front end or back end?

511


How to close a session properly?

530


Tell me are parent constructors called implicitly inside a class constructor?

544


What is mysql_real_escape_string used for?

561


What are the advantages of php mysql?

521