Hi
Can someone please explain why it prints 2?
Code:<?php
if ('EMAIL' == 'EMAIL'){
print "1";
}else{
print "2";
}
?>
Thanks
Printable View
Hi
Can someone please explain why it prints 2?
Code:<?php
if ('EMAIL' == 'EMAIL'){
print "1";
}else{
print "2";
}
?>
Thanks
Works fine for me:
Are you sure that's the exact code you are testing?Code:C:\Windows\Temp>php -r "if('EMAIL' == 'EMAIL') { print '1';} else {print '2';}"
1
C:\Windows\Temp>
That IS the actual thing, and I posted it here because I could not find any reason why it would not match. I mean both are simple strings. If you copy/paste my above code and try it on ur end, it will not work.
I just wanna know the reason.
Thanks
You have some sort of non-printing character right before the "E" of the first "EMAIL" (between the quote and the "E").
Thanks fro your kind help