note 101646 added to functions.returning-values

From: Date: Sun, 02 Jan 2011 01:57:36 +0000
Subject: note 101646 added to functions.returning-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-175386@lists.php.net to get a copy of this message
I found this 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() { $function_name_array = array('one','two','three'); return $function_name_array; } //###############################/// // THIS IS WHERE WE CALL THE FUNCTION AND THE ARRAY IS RETURNED /// $array_returned = function_name(); echo implode(',', $array_returned); ///##############################/// ?> ---- 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/101646 Del: integrated -- https://master.php.net/note/delete/101646/integrated Del: useless -- https://master.php.net/note/delete/101646/useless Del: bad code -- https://master.php.net/note/delete/101646/bad+code Del: spam -- https://master.php.net/note/delete/101646/spam Del: non-english -- https://master.php.net/note/delete/101646/non-english Del: in docs -- https://master.php.net/note/delete/101646/in+docs Del: other reasons-- https://master.php.net/note/delete/101646 Reject -- https://master.php.net/note/reject/101646 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175386) next »