Summary caseæã«ã¯é¢æ°ã使ç¨å¯è½ï¼ switch æã®å¼æ°ã0ã®æã«switchæãæãã¦ãã¾ãã®ã§ï¼switch(true)ãå©ç¨ãããã¨ã§åé¿ï¼ æªãä¾ $var = 0; // switch æã falseã¨è©ä¾¡ããã¦ãã¾ã switch($var) { case ($var == 0): echo "0!"; break; default: break; } è¯ãä¾ $var = 0; // switch æãå¼·å¶çã«trueã§è©ä¾¡ switch(true) { case ($var == 0): echo "0!"; break; default: break; } Sample $test = 'aaa'; switch (true) { case ($test > 10): echo "10!"; break; case is_numeric($test): e
{{#tags}}- {{label}}
{{/tags}}