Created
October 1, 2019 08:14
-
-
Save daveh/a9c2e66146df26d391272036683bf66e to your computer and use it in GitHub Desktop.
Example 2 of assignments inside conditionals (https://youtu.be/UaxP0aMeT5w)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = ['red', 'green', 'blue']; | |
$quantity = count($array); | |
// if ($quantity == 5) | |
//if ($quantity = 5) | |
if (5 == $quantity) | |
{ | |
echo "There are five items"; | |
} else { | |
echo "There are NOT five items"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment