|
Search:
Advanced search
|
Browse by category:
|
Contact Us |
How to Return more than one value from a PHP array |
|||||
Easy Example how to return more than one value from a PHP array without using a loop to extract the values:
=================================================== <?php function getFruit ($var1,$var2) { $var1="Apple"; $var2="Banana"; return array($var1,$var2);; } list($fruit1,$fruit2)=getFruit("steak","chicken"); echo "$fruit1<BR>$fruit2"; ?> =================================================== Results: Apple Banana |
|||||
Powered by
KBPublisher (Knowledge base software)