Web Programming With PHP
Web Programming With PHP
with PHP
Chapter 3
Building Expressions
Building Expressions
$DivisionResult = 15 / 6;
$ModulusResult = 15 % 6;
echo "<p>15 divided by 6 is
$DivisionResult.</p>"; // prints '2.5'
echo "The whole number 6 goes into 15 twice, with a
remainder of $ModulusResult.</p>"; // prints '3'
$BlackjackPlayer1 = 20;
($BlackjackPlayer1 <= 21) ? $Result =
"Player 1 is still in the game.“ :
$Result =
"Player 1 is out of the action.";
echo "<p>", $Result, "</p>";