note 97816 deleted from function.exit by danbrown

From: Date: Mon, 10 May 2010 12:11:47 +0000
Subject: note 97816 deleted from function.exit by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169116@lists.php.net to get a copy of this message
Note Submitter: zero dot affect at hotmail dot com ---- I was making a few functions and i thought it would be easier to use a single function to close off my code, The following is a example of it working i am sure if you include footer code when exiting code all the time you'll understand the purpose of the following function. <?php function error_msg($text) { # add other stuff you may want here $hello_var = 'hello'; //example of addon to beginning $goodbye_var = 'goodbye'; //example of addon to end exit($hello_var.'<br />'.$text.'<br />'.$goodbye_var); } error_msg('how are you?'); ?> Outputs: hello how are you? goodbye

« previous php.notes (#169116) next »