Hello Reader's!, If you have a condition in which you need to return two or more variable from function like below:-
functions()
{
//you calculation for result
return $a, $b;
}
Now you will face the error. But you can use the array function to return as a single variable, See the example below:-
function ()
{
//your calculation part goes here
$result = array();
$result = ['var a' => $a, 'var b' => $b ];
//now you can easily return this $result array
return $result;
}
0 Comment(s)