I can't work out what is causing this strange problem with PHP 'incorrectly' determining the contents of a variable. In the run whos output I quote, $type = 0. However, PHP doesn't seem to recognise this. Here is the code:
Code: Select all
if( $page == 1 )
{
if( $loc == 'ALL_LOCS' )
{
if( $type == 'ALL_TYPES' )
{
echo 'PHP thinks that '.$type.' == ALL_TYPES!!';
}
elseif( $type != 'ALL_TYPES' )
{Code: Select all
PHP thinks that 0 == ALL_TYPES!!Can anyone shed any light on this problem? Why is it thinking that 0 is equal to any string I place in the if statement?
Many thanks
Mark