{"id":3485,"date":"2023-10-07T11:03:52","date_gmt":"2023-10-07T02:03:52","guid":{"rendered":"https:\/\/blue-bear.jp\/kb\/?p=3485"},"modified":"2023-10-07T11:03:53","modified_gmt":"2023-10-07T02:03:53","slug":"php%e6%96%87%e5%ad%97%e5%88%97%e3%81%99%e3%81%b9%e3%81%a6%e3%82%b9%e3%83%9a%e3%83%bc%e3%82%b9%e3%81%8b%e3%81%a9%e3%81%86%e3%81%8b%e5%88%a4%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/php%e6%96%87%e5%ad%97%e5%88%97%e3%81%99%e3%81%b9%e3%81%a6%e3%82%b9%e3%83%9a%e3%83%bc%e3%82%b9%e3%81%8b%e3%81%a9%e3%81%86%e3%81%8b%e5%88%a4%e5%ae%9a\/","title":{"rendered":"[PHP]\u6587\u5b57\u5217\u3059\u3079\u3066\u30b9\u30da\u30fc\u30b9\u304b\u3069\u3046\u304b\u5224\u5b9a"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nfunction isStringOnlySpaces($str) {\n    \/\/ Use a regular expression to check if the string contains only spaces\n    return preg_match('\/^&#91;\\s\\x{3000}]*$\/u', $str);\n}\n\n\/\/ Test cases\n$string1 = \"   \";  \/\/ Only contains spaces (single-byte)\n$string2 = \"\u3000\u3000\";  \/\/ Only contains spaces (double-byte)\n$string3 = \"Hello, world!\";  \/\/ Contains non-space characters\n\nif (isStringOnlySpaces($string1)) {\n    echo \"String 1 contains only spaces.\\n\";\n} else {\n    echo \"String 1 does not contain only spaces.\\n\";\n}\n\nif (isStringOnlySpaces($string2)) {\n    echo \"String 2 contains only spaces.\\n\";\n} else {\n    echo \"String 2 does not contain only spaces.\\n\";\n}\n\nif (isStringOnlySpaces($string3)) {\n    echo \"String 3 contains only spaces.\\n\";\n} else {\n    echo \"String 3 does not contain only spaces.\\n\";\n}\n?>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/3485"}],"collection":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/comments?post=3485"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/3485\/revisions"}],"predecessor-version":[{"id":3486,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/3485\/revisions\/3486"}],"wp:attachment":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media?parent=3485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=3485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=3485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}