note 101646 deleted from functions.returning-values by danbrown
| From: | danbrown@php.net | Date: | Mon, 03 Jan 2011 17:31:25 +0000 |
| Subject: | note 101646 deleted from functions.returning-values by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175420@lists.php.net to get a copy of this message | ||
Note Submitter: falkon303 at gmail dot com
----
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);
///##############################///
?>