shoyebzz

Returnt 2 or more value in a function

May 8th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. function math_function($val1, $val2, $string){
  2.     $math = $val1 + $val2;
  3.     return  array($math, $string);
  4. }
  5.  
  6. list($mathval, $stringval) = math_function(10,5, "The result");
  7.  
  8. echo $stringval ." ".  $mathval;
Advertisement
Add Comment
Please, Sign In to add comment