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