-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.php
More file actions
87 lines (68 loc) · 1.67 KB
/
operators.php
File metadata and controls
87 lines (68 loc) · 1.67 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?
$myAge = 45;
/* print "My age is " . $myAge . " and i will be "
. $myAge . " for the rest of the year.";
*/
// print "My age is {$myAge} and I will be {$myAge} for the rest of the year.";
?>
<?
// addition w/ quoted and un-quoted variables.
/* $testScore = "100";
$bonusPoint = 5;
$totalScore = $testScore + $bonusPoint;
print( "Your combined score is: {$totalScore}" );
*/
?>
<?
// boolean / logical operators
/* $isRegistered = true;
$hasParkingPermit = false;
if( $isRegistered == true )
{
if( $hasParkingPermit == true )
{
print( "Thank you for regstering for school and paying for parking." );
}
else
{
print( "Thank you for registering and walking to save the environment." );
}
}
*/
/*
$isRegistered = true;
$hasParkingPermit = false;
if( $isRegistered == true && $hasParkingPermit == true )
{
print( "Thank you for regstering for school and paying for parking." );
}
else if( $isRegistered == true || $hasParkingPermit == true )
{
print( "Thank you for buying SOMEthing to pay our bills." );
if( $isRegistered == true )
{
print( "Ah! you registered for class!" );
}
else if( $hasParkingPermit == true )
{
print( "Ah! you paid for parking!" );
}
}
*/
$isRegistered = true;
$hasParkingPermit = false;
$paidTuition = false;
$livesInTheDistrict = false;
if( ( $isRegistered && !$hasParkingPermit ) || ( $paidTuition && $livesInTheDistrict ) )
{
print( "Welcome to school!" );
}
?>
</body>
</html>