note 124552 added to function.getopt
| From: | rastyazhenko dot anton at gmail dot com | Date: | Sun, 29 Dec 2019 03:14:35 +0000 |
| Subject: | note 124552 added to function.getopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213646@lists.php.net to get a copy of this message | ||
$opts = getopt('', $params =
['ogrn:','inn:','kpp::','host:','port:','user:','pass:','path:','pattern:'])
+ ['kpp' => 0,'port' => 21,'path' =>
'/','pattern' => '.+\.dbf'];
array_map(function ($param) use ($opts) {
$matches = [];
if ((bool)preg_match('/(?<param>[^:\s]+)\b:$/sU', $param, $matches)
&& (!array_key_exists($matches['param'], $opts) ||
empty($opts[$matches['param']])))
die(sprintf('<prtg><error>1</error><text>%s not
set</text></text></error></prtg>', $matches['param']));
}, $params);
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.168 (proxied: 128.72.64.223)
----
Manual Page -- http://php.net/manual/en/function.getopt.php
Edit -- https://master.php.net/note/edit/124552
Del: integrated -- https://master.php.net/note/delete/124552/integrated
Del: useless -- https://master.php.net/note/delete/124552/useless
Del: bad code -- https://master.php.net/note/delete/124552/bad+code
Del: spam -- https://master.php.net/note/delete/124552/spam
Del: non-english -- https://master.php.net/note/delete/124552/non-english
Del: in docs -- https://master.php.net/note/delete/124552/in+docs
Del: other reasons-- https://master.php.net/note/delete/124552
Reject -- https://master.php.net/note/reject/124552
Search -- https://master.php.net/manage/user-notes.php