note 23380 added to function.exit
| From: | shaun at NOshatSPAM dot net | Date: | Wed, 17 Jul 2002 06:36:54 +0000 |
| Subject: | note 23380 added to function.exit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33191@lists.php.net to get a copy of this message | ||
Note that the argument to exit() does not have to be a literal string, it can also be a function.
For example, I have a function named error($type, $bgcolor, $message) which outputs an error message
inside of an HTML table (it looks a little nicer than a plaintext error in the middle of a page). I
was happy to notice that I can use this function along with exit(), e.g.
if(!isset($foobar))
exit(error("Fatal", "#FF0000", "Execution terminated because foobar
wasn't set"));
--
http://www.php.net/manual/en/function.exit.php
http://master.php.net/manage/user-notes.php?action=edit+23380
http://master.php.net/manage/user-notes.php?action=delete+23380
http://master.php.net/manage/user-notes.php?action=reject+23380