note 97815 deleted from function.die by salathe

From: Date: Thu, 19 Mar 2015 10:46:34 +0000
Subject: note 97815 deleted from function.die by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-201983@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 die($hello_var.'<br />'.$text.'<br />'.$goodbye_var); } error_msg('how are you?'); ?> Outputs: hello how are you? goodbye

« previous php.notes (#201983) next »