note 97815 added to function.die

From: Date: Mon, 10 May 2010 09:53:08 +0000
Subject: note 97815 added to function.die
Groups: php.notes 
Request: Send a blank email to php-notes+get-169108@lists.php.net to get a copy of this message
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); } echo error_msg('how are you?'); ?> Outputs: hello how are you? goodbye ---- Server IP: 92.48.74.199 Probable Submitter: 82.1.142.218 ---- Manual Page -- http://www.php.net/manual/en/function.die.php Edit -- https://master.php.net/note/edit/97815 Del: integrated -- https://master.php.net/note/delete/97815/integrated Del: useless -- https://master.php.net/note/delete/97815/useless Del: bad code -- https://master.php.net/note/delete/97815/bad+code Del: spam -- https://master.php.net/note/delete/97815/spam Del: non-english -- https://master.php.net/note/delete/97815/non-english Del: in docs -- https://master.php.net/note/delete/97815/in+docs Del: other reasons-- https://master.php.net/note/delete/97815 Reject -- https://master.php.net/note/reject/97815 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169108) next »