0

I'm very new to PHP, from what I've read the die() function pretty much just exits the current script.

So my question is, is it necessary to include it at the end of every script? or is it needed just under certain circumstances.

Thanks!

itailitai
  • 429
  • 1
  • 4
  • 15
  • It is not needed at the end of every script. I would use it during debugging to print a message and exit the script under certain conditions most likely. – Daniel Gale Sep 20 '18 at 12:15
  • I use exit() as last line to print templated stuff, but it is style not rule. Otherwise even ?> not needed if nothing comes after the PHP code. – Ákos Nikházy Sep 20 '18 at 12:27

0 Answers0