Register|Login

Have a question? Click here to ask the community.

Tutorial 12 – If Else Statements

| In: 12. If Else Statements | 7,454 views

Video Tutorial


Video Source Code
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
<?php
//File Description: PHP If...Else Statements
 
/*
if (you do not pay your phone bill) {
    your phone service will be discontinued
}
else {
    your phone service will continue as normal
}
 
*/
 
 
//Example 1
 
$billPaid = "No"; // has bill been paid
 
if ($billPaid == "Yes") { // if user has paid bill
    echo "Your acccount is in good standing";
}
else { // if user has not paid bill
    echo "Your phone will be turned off soon if you do not pay";
}
 
?>

Comment Form

You must be logged in to post a comment.