Last active
October 1, 2019 08:13
-
-
Save daveh/653a8da8b251399937be73aa3b598029 to your computer and use it in GitHub Desktop.
Example 1 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) | |
//if ($quantity = count($array)) | |
{ | |
echo "There are $quantity items"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment