What's the best practice here? Using die() or exit()? What's the difference between the two?
if($_GET['do_thing']):
echo 'bla bla';
exit(); // or die(), or something else?
endif;
I use die() when making mysql queries to log the errors, I use exit to bail out of loops.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With