Answers for "php elseif"

PHP
14

php elseif

<?php
if ($a > $b) {
    echo "a is bigger than b";
} elseif ($a == $b) {
    echo "a is equal to b";
} else {
    echo "a is smaller than b";
}
?>
Posted by: Guest on April-23-2020
7

php if else

<?php
if ($a > $b) {
    echo "a is bigger than b";
} elseif ($a == $b) {
    echo "a is equal to b";
} else {
    echo "a is smaller than b";
}
?>
Posted by: Guest on April-23-2020
13

php if elseif g

$a = random_int(0, 10);
$b = random_int(0, 10);
if ($a > $b) {
  echo 'a is greater than b';
} elseif ($a == $b) {
  echo 'a is equal to b';
} else {
  echo 'a is less than b';
}
Posted by: Guest on October-03-2020
0

php else

<?php
if ($a > $b) {
  echo "a is greater than b";
} else {
  echo "a is NOT greater than b";
}
?>
Posted by: Guest on April-23-2020
0

PHP if...else...elseif Statements

<?php
$t = date("H");

if ($t < "20") {
  echo "Have a good day!";
}
?>
Posted by: Guest on November-27-2020

Browse Popular Code Answers by Language