PHP If/Else problem
Posted: Thu Apr 03, 2008 5:32 pm
Greetings,
I don't understand why this VERY simple code doesn't seem to work in PHP:
***** PLEASE USE THE CODE TAG WHEN POSTING *****
I echo $num it is 1 so it goes in the loop and I echo $check it is order but somehow it skips that if statements and the final output will be "this is payment"
Does anybody knows why ?
Thanks,
I don't understand why this VERY simple code doesn't seem to work in PHP:
***** PLEASE USE THE CODE TAG WHEN POSTING *****
Code: Select all
if ($num == '1')
{
if($check == 'order')
{
echo "this is order";
}
else
{
echo "this is payment";
}
}I echo $num it is 1 so it goes in the loop and I echo $check it is order but somehow it skips that if statements and the final output will be "this is payment"
Does anybody knows why ?
Thanks,