An if Statement That Uses else and elseif : If : Language Basics PHP Source Code


PHP Source Code » Language Basics » If »

 

An if Statement That Uses else and elseif






<html>
<head>
<title>An if Statement That Uses else and elseif</title>
</head>
<body>
<?php
$mood = "sad";
if $mood == "happy" ){
    print "a good mood";

}elseif $mood == "sad" ){
    print "Don't be down!";
}else{
    print "Neither happy nor sad but $mood";
}
?>
</body>
 </html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» If