-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomp_operators.php
More file actions
47 lines (36 loc) · 1.38 KB
/
Copy pathcomp_operators.php
File metadata and controls
47 lines (36 loc) · 1.38 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
<?php
//I'm gonna try a few things here...
$age = 17; //Sets the age to 17 years
if ($age >= 18 && $age <= 70) {
echo "I am fit to drive.";
} else {
echo "I wont be allowed to drive.";
}
/* The little code above checks the age and determine whether the user will be
allowed to drive based on my comparison operator */
echo "<br>";
$rel_status = "together"; //So this is the current status of the user's relationship
if ($rel_status != "together") {
echo "I'll be deleting my WhatsApp";
} else {
echo "I dont have any reason to delete my WhatsApp.";
}
/* The little code above checks the rel_status and determine whether the user will delete
his WhatsApp based on my comparison operator */
echo "<br>";
$price = 100; //Sets value of price to 100
--$price; //Decreases the value of price by 1
if ($price > 100) {
echo "Its too expensive.";
}
if ($price < 100) {
echo "I can afford it without any hassle.";
}
/* Looks at the price and determines whether its expensive or not. I know I could have made it
easier by addint it into one if else statement but I just wanted it this way*/
echo "<br>";
$One_life_goal = "Robotics Engineer";
if ($One_life_goal == "Robotics Engineer") {
echo "I am still on track.";
}
?>