Php Folks,
Reading this link, did I understand correctly that you use exit() to halt the script and die() to halt the script after spitting out an error mssg on screen ?
https://stackoverflow.com/questions/1795025/what-are-the-differences-in-die-and-exit-in-php
So, the following 1 is equivalent to 2 ?
1.
2.
Latter seems shortest if you want to halt the script after giving an error. And so, best to use that. Right ?
And, if you don't want to give error then just use like this. Right ?
The above were rush rough examples.
Reading this link, did I understand correctly that you use exit() to halt the script and die() to halt the script after spitting out an error mssg on screen ?
https://stackoverflow.com/questions/1795025/what-are-the-differences-in-die-and-exit-in-php
So, the following 1 is equivalent to 2 ?
1.
PHP:
if(!1==2) {
echo "no match";
exit;
}
PHP:
if(!1==2) die("no match");
And, if you don't want to give error then just use like this. Right ?
PHP:
if(!1==2) {
exit;
}