1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-07-14 03:56:18 +02:00

More proofreading

This commit is contained in:
Andrew Davis
2018-12-26 19:10:58 -06:00
parent dc296aef34
commit 8970e4a0ce
3 changed files with 9 additions and 3 deletions

View File

@ -14,7 +14,7 @@ $a && $b;
$a && $c; $a && $c;
// Using two pipe characters checks if either value is true. // Using two pipe characters checks if either value is true.
// Then, it will return true. If both values are false, the PHP // Then, it will return true. If both values are false, then PHP
// returns false. // returns false.
$a = true; $a = true;
$b = false; $b = false;

View File

@ -2,7 +2,7 @@
// A boolean is a value that is always 0 or 1, yes or no, on or off. // A boolean is a value that is always 0 or 1, yes or no, on or off.
// In PHP, a boolean is represented by the words true and false. // In PHP, a boolean is represented by the words true and false.
// While programming, you will often want to know if something is true or false. // While programming, you will often want to know if something is positive or negative.
$a = true; $a = true;
$b = false; $b = false;
@ -35,7 +35,13 @@ $one >= $two;
// by using three equal signs. // by using three equal signs.
// This returns true. // This returns true.
1 == 1;
1 == '1'; 1 == '1';
1 == true;
1 == 1.0;
1 === 1;
// This returns false. // This returns false.
1 === '1'; 1 === '1';
1 === true;
1 === 1.0;

View File

@ -62,7 +62,7 @@ switch ($drink) {
$language = 'english'; $language = 'english';
echo $language == 'spanish' ? "hola\n" : "hello\n"; echo $language == 'spanish' ? "hola\n" : "hello\n";
// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of two question marks if value is null. // Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null.
echo $IDoNotExist ?? "Variable not set\n"; echo $IDoNotExist ?? "Variable not set\n";
// You can also chain multiple checks in a row. // You can also chain multiple checks in a row.