PHP Tutorial : Exit and Die Functions

hi,
I have two mins to write about those two very basic functions which will make your script to stop completely, the code will not be interpreted anymore before the line where says exit or die. have some tests (first one will exit without any notice and with the second one you can show a message to the browser before stoping the script)

<?php

print "something";
exit();

print "will not print";
//or like this which will show a message too
print "something else";
die("message");
?>
This entry was posted in Short PHP Functions and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>