php - How to return multiple value from one function? -
i create simple web in php , want return multiple variables 1 function. possible or not. , possible how?
you can return array
function dosth(){ $a = 2; $b = 5 $c = 9; return array($a,$b,$c); }
and use list()
method single values:
list($a, $b, $c) = dosth(); echo $a; echo $b; echo $c;
Comments
Post a Comment