I just want to use array_walk()
with ceil()
to round all the elements within an array. But it doesn't work.
The code:
$numbs = array(3, 5.5, -10.5);
array_walk($numbs, "ceil");
print_r($numbs);
output should be: 3,6,-10
The error message:
Warning: ceil() expects exactly 1 parameter, 2 given on line 2
output is: 3,5.5,-10.5 (Same as before using ceil())
I also tried with round()
.