note 97816 added to function.exit

From: Date: Mon, 10 May 2010 09:55:00 +0000
Subject: note 97816 added to function.exit
Groups: php.notes 
Request: Send a blank email to php-notes+get-169109@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 exit($hello_var.'<br />'.$text.'<br />'.$goodbye_var); } 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.exit.php Edit -- https://master.php.net/note/edit/97816 Del: integrated -- https://master.php.net/note/delete/97816/integrated Del: useless -- https://master.php.net/note/delete/97816/useless Del: bad code -- https://master.php.net/note/delete/97816/bad+code Del: spam -- https://master.php.net/note/delete/97816/spam Del: non-english -- https://master.php.net/note/delete/97816/non-english Del: in docs -- https://master.php.net/note/delete/97816/in+docs Del: other reasons-- https://master.php.net/note/delete/97816 Reject -- https://master.php.net/note/reject/97816 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169109) next »