Hi,
Today, i we will show you php conditional statement example. This article will give you simple example of php conditional statement example. you will learn php conditional statement example.
This example to i am use in if condition,if..else condition,if…else if…else condition and last to use in switch case conditional statement use.
So let’s follow few step to create example of how to dropzone add download button in php.
If Condition
<?php $t = 120; if ($t == "120") { echo "Have a good day!<br>"; } ?>
if…elseif…else Condition
<?php $t = 120; if ($t != "120") { echo "Have a good morning!<br>"; } elseif ($t == "120") { echo "Have a good day!<br>"; } else { echo "Have a good night!<br>"; } ?>
Switch..case Conditional
<?php $favcolor = "blue"; switch ($favcolor) { case "red": echo "Your favorite color is red!<br>"; break; case "blue": echo "Your favorite color is blue!<br>"; break; case "green": echo "Your favorite color is green!<br>"; break; default: echo "Your favorite color is neither red, blue, nor green!<br>"; } ?>
I hope it will assist you…