note 101647 added to functions.returning-values

From: Date: Sun, 02 Jan 2011 02:00:51 +0000
Subject: note 101647 added to functions.returning-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-175387@lists.php.net to get a copy of this message
I found this short function to be the most useful for returning array values using a function. I hope you guys find it useful too. <?php // THIS IS THE FUNCTION THAT CREATES AN ARRAY // function function_name() { // optional to set array as a variable here/// return array('one','two','three'); } //###############################/// // THIS IS WHERE THE FUNCTION ARRAY IS RETURNED /// echo implode(',', function_name()); ///##############################/// ?> ---- Server IP: 69.147.83.197 Probable Submitter: 71.197.204.162 ---- Manual Page -- http://www.php.net/manual/en/functions.returning-values.php Edit -- https://master.php.net/note/edit/101647 Del: integrated -- https://master.php.net/note/delete/101647/integrated Del: useless -- https://master.php.net/note/delete/101647/useless Del: bad code -- https://master.php.net/note/delete/101647/bad+code Del: spam -- https://master.php.net/note/delete/101647/spam Del: non-english -- https://master.php.net/note/delete/101647/non-english Del: in docs -- https://master.php.net/note/delete/101647/in+docs Del: other reasons-- https://master.php.net/note/delete/101647 Reject -- https://master.php.net/note/reject/101647 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175387) next »