note 126708 added to control-structures.match
| From: | manoj904378 at gmail dot com | Date: | Fri, 24 Dec 2021 09:32:04 +0000 |
| Subject: | note 126708 added to control-structures.match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217411@lists.php.net to get a copy of this message | ||
When & Where should you use? that's most important part of match
<?php
$Error_Code=(int) 400;
$message=(string) match($Error_Code){
200=>"OK",
400=>"Bad Request",
401=>"Unauthorized",
403=>"Forbidden",
404=>"Not Found",
default=>"Unknown Error"
};
var_dump($message); // string(11) "Bad Request"
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 103.169.56.40)
----
Manual Page -- https://php.net/manual/en/control-structures.match.php
Edit -- https://main.php.net/note/edit/126708
Del: integrated -- https://main.php.net/note/delete/126708/integrated
Del: useless -- https://main.php.net/note/delete/126708/useless
Del: bad code -- https://main.php.net/note/delete/126708/bad+code
Del: spam -- https://main.php.net/note/delete/126708/spam
Del: non-english -- https://main.php.net/note/delete/126708/non-english
Del: in docs -- https://main.php.net/note/delete/126708/in+docs
Del: other reasons-- https://main.php.net/note/delete/126708
Reject -- https://main.php.net/note/reject/126708
Search -- https://main.php.net/manage/user-notes.php