-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif_and_or.php
More file actions
56 lines (37 loc) · 1.05 KB
/
if_and_or.php
File metadata and controls
56 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
$x = 0;
$y = 5;
$z = 10;
// TODO:
// If $x < $y < $z then echo "{$x} < {$y} < {$z}\n";
if ($x < $y && $y < $z) {
echo "$x < $y < $z" . PHP_EOL;
}
// TODO:
// If 0 is less than $x OR $x is less than 10
// then echo the result as a sentence "0 is less than {$x} OR {$x} is less than 10".
if (0 < $x || $x < 10) {
echo "0 is less than $x or $x is less than 10" . PHP_EOL;
}
// TODO:
// repeat the if statement for $y and $z.
if (0 < $y || $y < 10) {
echo "0 is less than $y or $y is less than 10" . PHP_EOL;
}
if (0 < $z || $z < 10) {
echo "0 is less than $z or $z is less than 10" . PHP_EOL;
}
// TODO:
// If 0 is less than $x AND $x is less than 10
// then echo the result as a sentence "0 is less than {$x} AND {$x} is less than 10".
if ( 0 < $x && $x < 10) {
echo "0 is less than $x and $x is less than 10" . PHP_EOL;
}
// TODO:
// repeat the if statement for $y and $z.
if (0 < $y && $y < 10) {
echo "0 is less than $y and $y is less than 10" . PHP_EOL;
}
if (0 < $z && $z < 10) {
echo "0 is less than $z and $z is less than 10" . PHP_EOL;
}