Is the die() or exit() function needed in the end of a php script?

Viewed 6674

In a php script I have some test and after the script the html page.

When a test fail i call die("Test 1 failed"); If no test fail the php script reach the end ?> and then load the html code after the php script.

Is this a good procedure? Or I need to write die() or exit() before the end of php script?

9 Answers

Nope, you don't need to call die() or exit(0 if you have another code to run, like you HTML code

Related