{"id":6245,"date":"2023-04-03T16:46:37","date_gmt":"2023-04-03T07:46:37","guid":{"rendered":"https:\/\/nsme.net\/notes\/?p=6245"},"modified":"2023-04-03T18:09:22","modified_gmt":"2023-04-03T09:09:22","slug":"%e3%83%91%e3%82%b9%e3%83%af%e3%83%bc%e3%83%89%e7%94%9f%e6%88%90-2","status":"publish","type":"post","link":"https:\/\/core.nsme.net\/notes\/php\/%e9%96%a2%e6%95%b0\/6245\/","title":{"rendered":"\u30d1\u30b9\u30ef\u30fc\u30c9\u751f\u6210"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/ameblo.jp\/itboy\/entry-10217415698.html\">\u30dd\u30ea\u30b7\u30fc\u306b\u3042\u308f\u305b\u3066\u30e9\u30f3\u30c0\u30e0\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b<\/a><a href=\"\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function createPassword($length = 8){\n    $pwd_strings = array(\"sletter\" => range('a', 'z'),\n                         \"cletter\" => range('A', 'Z'),\n                         \"number\"  => range('0', '9'),\n                         \"symbol\"  => array_merge(range('!', '\/'), range(':', '?'), range('{', '~')));\n\n    $pwd = array();\n    while (count($pwd) &lt; $length) {\n\n\/\/ 4\u7a2e\u985e\u5fc5\u305a\u5165\u308c\u308b\n        if (count($pwd) &lt; 4) {\n            $key = key($pwd_strings);\n            next($pwd_strings);\n        } else {\n\/\/ \u5f8c\u306f\u30e9\u30f3\u30c0\u30e0\u306b\u53d6\u5f97\n            $key = array_rand($pwd_strings);\n        }\n        $pwd&#91;] = $pwd_strings&#91;$key]&#91;array_rand($pwd_strings&#91;$key])];\n    }\n\/\/ \u751f\u6210\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u9806\u756a\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u4e26\u3073\u66ff\u3048\n    shuffle($pwd);\n\n    return implode($pwd);\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30dd\u30ea\u30b7\u30fc\u306b\u3042\u308f\u305b\u3066\u30e9\u30f3\u30c0\u30e0\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-6245","post","type-post","status-publish","format-standard","hentry","category-27"],"acf":[],"_links":{"self":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/comments?post=6245"}],"version-history":[{"count":3,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6245\/revisions"}],"predecessor-version":[{"id":6248,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6245\/revisions\/6248"}],"wp:attachment":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/media?parent=6245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/categories?post=6245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/tags?post=6245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}