Hi
$var1 = 22;
$var2 = 10;
echo $var1 = ($var1 < $var2) ? $var1 : $var2; //smaller var
echo '<br />';
echo $var2 = ($var1 > $var2) ? $var1 : $var2; //greater var
I expect it to print 10 and 22
but it prints 10 and 10
. any ideas what I am doing wrong?
Thanks
UPDATE Thanks all.
$min = min($var1, $var2);
$max = max($var1, $var2);
$var1 = $min;
$var2 = $max;