- 1

What's wrong with this code?

<?php function mult($num1, $num2) { $res = $num1 * $num2; $ted = $num1 + $num2; $josh = $num1 - $num2; $what = $num1 / $num2; $meg = array($res, $ted, $josh, $what); return $meg; } echo mult(8, 3); ?>

10th Feb 2017, 1:13 PM
Joshua
Joshua - avatar
1 Answer
+ 4
you can't echo an array. use implode() to convert the array to a string.
10th Feb 2017, 1:37 PM
Mario L.
Mario L. - avatar