+ 1

Does the end tag of php needed for a pure php file?

So I ran into a few people who tell me that the end tag in php ?> Is only needed if a developer puts php code in HTML code. Ex: <DOCTYPE! Html> <head> <title><title> </head><body> <body> <p>some text</p> <?php echo'hello'; ?> </body> While in a pure php file Ex: <?php echo'hello';

24th Feb 2019, 7:38 AM
Brett
Brett - avatar
2 Respostas
+ 4
You only need end tag ?>, if the php page end with html code.
25th Feb 2019, 6:42 AM
Calviղ
Calviղ - avatar
- 1
//No you need ?> End tag in pure php file too
24th Feb 2019, 8:18 AM
Sudarshan Rai
Sudarshan Rai - avatar