Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $n = 12;
- if ($n % 2 == 0){
- echo "$n is a even number";
- }else{
- echo "$n is a odd number";
- }
- echo "<br/>";
- if ($n > 10) {
- echo "$n is greater then 10";
- }
- echo "<br/>";
- $m = 12;
- $s = 13;
- if ($m != $s) {
- echo "M is qual to N";
- }else{
- echo "M is not equal to N";
- }
- echo "<br/>";
- $age = 13;
- if ($age >= 13 && $age <=19) {
- echo "This is a teenager";
- }else{
- echo "this person not a teenager";
- }
- echo "<br/>";
- $food = "salmon";
- if ("tuna" == $food || "salmon" == $food) {
- echo "{$food} has vitamin D";
- }elseif ("apple"==$food) {
- echo "Apple dose not contain vitamin D";
- }else{
- echo "we dont know if {$food} contain vitamin D";
- }
- // Operator
- /*==
- !=
- >
- <
- =>
- >=
- &&
- ||*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement