Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$a = 5;
$b = 24;
$c = 12;
if ($a > $b) {
$min = $b;
$max = $a;
} else {
$min = $a;
$max = $b;
}
if ($c > $max) {
$max = $c;
} elseif ($c < $min) {
$min = $c;
}
echo "MIN = " . $min . ", MAX = " . $max;