I'm trying to compare the value entered by user ($b
) with another value which is retrieved from my database tables ($a
).
In theory, the below code should retrieve error 1 but it's not. Can you please help me understand what I'm doing wrong?
{$a=array('54607');
$b=array('54606');
if($a < $b){
echo "error 1";
}elseif($a == $b){
echo "error 2";
}else{
echo "TRUE";
}
P.S. I'm a newbie in PHP so please be gentle and sorry in advance for any silly questions I may have.