Browse - programming tips - php receive an array from a functionDate: 2008may16 Language: php Q. What the best way to accept an array from a function? A. Use list(), like this: function returnArray() { return array('one', 'two'); } function acceptArray() { # Note the use of list here. list($a, $b) = returnArray(); print "a=$a\n"; print "b=$b\n"; }
Add a commentSign in to add a comment | Advertisements:
|