if you run the folowing code
Code: Select all
function insane($value)
{
if($value==0)
{
print "matched";
}
}
insane(0);
now run:
Code: Select all
function insane($value)
{
if($value=='this')
{
print "matched";
}
}
insane(0);
now try:
Code: Select all
function insane($value)
{
if($value=='this')
{
print "this ";
}
if($value=='is')
{
print "is ";
}
if($value=='ridiculous')
{
print "ridiculous";
}
}
insane(0);
I've never understood this odd behaviour of php, that all strings are 0, is that because a string has 0 value?