I wanted to have a result like this
50+2+2+2+2 = 58
But I'm getting these kind of result
50
2
2
2
2
these are my codes.
<?php
$height = 50;
echo $height;
function hey($x)
{
return $height += $x;
}
$i = 4;
while($i != 0)
{
echo "<br>".hey(2);
$i--;
}
?>
Please take note that the location of my variable and loop must be and really meant at that position.
what do i need to change on my code. I am new in using php functions. thanks for the help.