php Switch statement and 0 -


hi see code today that

$i=0; switch($i){     case 'test': print "test";break;     case 0: print "0";break; }  

the normal output seems 0 prints test. try understand , got solution here. is, when compare number string string convert number , comparison performed numerically. ok ok output test.

but if set identical

$i=0; switch($i){     case ($a === 'test'): print "text";break;     case ($a === 0): print "0";break; } 

that give result test confused here. , if use == instead of === show blank. please clear me that.

do have make $i numeric? let string too...

$i="0"; switch($i){     case 'test': print "text";break;     case '0': print "0";break; } 

that prints 0...


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -