Math Operations
It will echo back 12+4+$value1 and multiplied by $value2 then divided by 2 minus 5
$value1 = 4; $value2 = 5; echo ((12 + 4 + $value1) * $value2) / 2 - 5; // result is 45Using +=, -=, *= and /= will update the value of $price
$price = 8; echo $price += 8; echo ', '; // new value of $price = 16 echo $price -= 8; echo ', '; // new value of $price = 8 echo $price *= 8; echo ', '; // new value of $price = 64 echo $price /= 8; echo ', '; // new value of $price = 8Incrementing (go up by 1)
$student = 4; $student++; echo $student; // result is 5Decrementing (go down by 1)
$student = 4; $student--; echo $student; // result is 3
No comments:
Post a Comment