note 76440 deleted from control-structures.switch by cmb

From: Date: Sun, 21 Apr 2019 11:50:39 +0000
Subject: note 76440 deleted from control-structures.switch by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210642@lists.php.net to get a copy of this message
Note Submitter: Drake ---- Also, when using switch for mode selecting on websites like: switch($_GET['mode']) { case "gallery": //code break; case "news": //code break; case "stuff": //code break; default, etc etc } Will NOT trigger the string == 0 bug, because $_GET automatically parse anything passed to them as strings. (same applies for all browser variables: SESSION, POST etc) so passing: mode=0 into the address bar is the same as: $_GET['mode'] = "0"; //not $_GET['mode'] = 0; thought it may help.

« previous php.notes (#210642) next »