{"id":3470,"date":"2025-03-24T08:46:06","date_gmt":"2025-03-23T23:46:06","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3470"},"modified":"2025-03-24T08:46:37","modified_gmt":"2025-03-23T23:46:37","slug":"%e3%80%90%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89%e3%80%91php%e3%81%a7%e6%96%87%e5%ad%97%e5%88%97%e5%88%87%e3%82%8a%e5%87%ba%e3%81%97%e3%82%92%e6%a5%b5%e3%82%81%e3%82%8b10%e3%81%ae%e5%bf%85","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3470","title":{"rendered":"\u3010\u5b8c\u5168\u30ac\u30a4\u30c9\u3011PHP\u3067\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u3092\u6975\u3081\u308b10\u306e\u5fc5\u9808\u30c6\u30af\u30cb\u30c3\u30af"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">PHP\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u6587\u5b57\u5217\u64cd\u4f5c\u304c\u91cd\u8981\u306a\u7406\u7531<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">PHP\u304c\u63d0\u4f9b\u3059\u308b\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u57fa\u672c\u30a2\u30d7\u30ed\u30fc\u30c1<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-3\">\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u95a2\u6570\u306e\u5fb9\u5e95\u89e3\u8aac<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-4\">substr()\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3068\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u610f\u5473<\/a>      <\/li>      <li>        <a href=\"#i-5\">\u90e8\u5206\u6587\u5b57\u5217\u306e\u53d6\u5f97\u306b\u5f79\u7acb\u3064strpos()\u3068strrpos()\u306e\u6d3b\u7528\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-6\">explode()\u3068implode()\u3092\u4f7f\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u5206\u5272\u3068\u7d50\u5408\u306e\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-7\">\u65e5\u672c\u8a9e\u306a\u3069\u591a\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u5b89\u5168\u306b\u51e6\u7406\u3059\u308b\u65b9\u6cd5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-8\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u51e6\u7406\u306e\u843d\u3068\u3057\u7a74\u3068\u5bfe\u51e6\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-9\">mb_substr()\u95a2\u6570\u3092\u4f7f\u3063\u305f\u6b63\u78ba\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-10\">\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8003\u616e\u3057\u305f\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-11\">\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-12\">preg_match()\u3068preg_match_all()\u306b\u3088\u308b\u67d4\u8edf\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/a>      <\/li>      <li>        <a href=\"#i-13\">\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u62bd\u51fa\u306b\u5f79\u7acb\u3064\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-17\">\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u969b\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-22\">preg_match()\u3068preg_match_all()\u306b\u3088\u308b\u67d4\u8edf\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/a>      <\/li>      <li>        <a href=\"#i-23\">\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u62bd\u51fa\u306b\u5f79\u7acb\u3064\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-27\">\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u969b\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-35\">\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-36\">\u30e1\u30e2\u30ea\u52b9\u7387\u3092\u8003\u616e\u3057\u305f\u5927\u91cf\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306e\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-42\">\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u304a\u3051\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u9632\u6b62\u7b56<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-48\">PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u306e\u4e92\u63db\u6027\u3092\u7dad\u6301\u3059\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-53\">\u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u5b9f\u8df5\u4f8b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-54\">CSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u5b9f\u88c5\u4f8b<\/a>      <\/li>      <li>        <a href=\"#i-58\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u691c\u8a3c\u3068\u6574\u5f62\u306b\u4f7f\u3048\u308b\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-61\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u3084JSON\u304b\u3089\u306e\u5fc5\u8981\u60c5\u5831\u62bd\u51fa\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-65\">PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6d3b\u7528<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-66\">Stringy\u3084Symfony String\u306a\u3069\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u7d39\u4ecb<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-70\">\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u3092\u7c21\u7565\u5316\u3059\u308b\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u5b9f\u88c5\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-75\">\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u5f15\u304d\u4e0a\u3052\u308b\u305f\u3081\u306b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-76\">\u3088\u308a\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-81\">\u5b9f\u52d9\u306b\u304a\u3051\u308bPHP\u6587\u5b57\u5217\u51e6\u7406\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u624b\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-85\">\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u5f15\u304d\u4e0a\u3052\u308b\u305f\u3081\u306e\u5b9f\u8df5\u30a8\u30af\u30b5\u30b5\u30a4\u30ba<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-89\">\u307e\u3068\u3081\uff1aPHP\u306e\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30de\u30b9\u30bf\u30fc\u3078\u306e\u9053<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">PHP\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<p>PHP\u306f\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u975e\u5e38\u306b\u5f37\u529b\u306a\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u304a\u3044\u3066\u6587\u5b57\u5217\u3092\u52b9\u7387\u7684\u306b\u6271\u3046\u3053\u3068\u306f\u57fa\u672c\u7684\u304b\u3064\u4e0d\u53ef\u6b20\u306a\u30b9\u30ad\u30eb\u3067\u3059\u3002\u6587\u5b57\u5217\u306e\u5207\u308a\u51fa\u3057\u3001\u691c\u7d22\u3001\u7f6e\u63db\u306a\u3069\u306e\u64cd\u4f5c\u306f\u3001\u65e5\u5e38\u7684\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30bf\u30b9\u30af\u306e\u4e2d\u6838\u3092\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u306a\u305c\u6587\u5b57\u5217\u64cd\u4f5c\u304c\u3053\u308c\u307b\u3069\u91cd\u8981\u306a\u306e\u304b\u3001\u305d\u3057\u3066PHP\u304c\u3069\u306e\u3088\u3046\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u6587\u5b57\u5217\u64cd\u4f5c\u304c\u91cd\u8981\u306a\u7406\u7531<\/h3>\n\n\n\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u73fe\u5834\u3067\u306f\u3001\u6587\u5b57\u5217\u64cd\u4f5c\u306f\u81f3\u308b\u3068\u3053\u308d\u3067\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u91cd\u8981\u306a\u7406\u7531\u3092\u3044\u304f\u3064\u304b\u6319\u3052\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u51e6\u7406\u3068\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u30c1\u30a7\u30c3\u30af\u3068\u6574\u5f62<\/li>\n\n\n\n<li>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3084\u96fb\u8a71\u756a\u53f7\u306a\u3069\u306e\u66f8\u5f0f\u691c\u8a3c<\/li>\n\n\n\n<li>\u60aa\u610f\u306e\u3042\u308b\u5165\u529b\uff08SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3084XSS\u306a\u3069\uff09\u306e\u9632\u6b62<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u52d5\u7684\u306aSQL\u30af\u30a8\u30ea\u306e\u69cb\u7bc9<\/li>\n\n\n\n<li>\u30af\u30a8\u30ea\u7d50\u679c\u306e\u6574\u5f62\u3068\u8868\u793a<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>API\u9023\u643a<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>JSON\u3084XML\u30ec\u30b9\u30dd\u30f3\u30b9\u304b\u3089\u306e\u5fc5\u8981\u60c5\u5831\u62bd\u51fa<\/li>\n\n\n\n<li>API\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u69cb\u7bc9<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30b3\u30f3\u30c6\u30f3\u30c4\u7ba1\u7406<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>HTML\u306e\u751f\u6210\u3068\u64cd\u4f5c<\/li>\n\n\n\n<li>\u30c6\u30ad\u30b9\u30c8\u306e\u8981\u7d04\u3084\u5207\u308a\u8a70\u3081\uff08\u4f8b\uff1a\u300c\u7d9a\u304d\u3092\u8aad\u3080\u300d\u6a5f\u80fd\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>URI\u306e\u89e3\u6790<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>URL\u304b\u3089\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u62bd\u51fa<\/li>\n\n\n\n<li>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u51e6\u7406<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30bf\u30b9\u30af\u3092\u52b9\u7387\u7684\u304b\u3064\u5b89\u5168\u306b\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f\u3001PHP\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570\u3092\u6df1\u304f\u7406\u89e3\u3057\u3001\u9069\u5207\u306b\u4f7f\u3044\u3053\u306a\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">PHP\u304c\u63d0\u4f9b\u3059\u308b\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u57fa\u672c\u30a2\u30d7\u30ed\u30fc\u30c1<\/h3>\n\n\n\n<p>PHP\u3067\u306f\u3001\u6587\u5b57\u5217\u304b\u3089\u5fc5\u8981\u306a\u90e8\u5206\u3092\u5207\u308a\u51fa\u3059\u305f\u3081\u306e3\u3064\u306e\u57fa\u672c\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u4f4d\u7f6e\u6307\u5b9a\u306b\u3088\u308b\u5207\u308a\u51fa\u3057<\/strong>\uff1a \u7279\u5b9a\u306e\u958b\u59cb\u4f4d\u7f6e\u304b\u3089\u6307\u5b9a\u3057\u305f\u9577\u3055\u306e\u6587\u5b57\u5217\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002 <code>\/\/ \u6587\u5b57\u5217\u306e3\u6587\u5b57\u76ee\u304b\u30895\u6587\u5b57\u5206\u3092\u5207\u308a\u51fa\u3059 $text = \"Hello World\"; $part = substr($text, 2, 5); \/\/ \"llo W\"<\/code><\/li>\n\n\n\n<li><strong>\u533a\u5207\u308a\u6587\u5b57\u306b\u3088\u308b\u5206\u5272<\/strong>\uff1a \u7279\u5b9a\u306e\u533a\u5207\u308a\u6587\u5b57\uff08\u30c7\u30ea\u30df\u30bf\uff09\u3092\u57fa\u6e96\u306b\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u3001\u5fc5\u8981\u306a\u90e8\u5206\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002 <code>\/\/ \u30ab\u30f3\u30de\u3067\u5206\u5272\u3057\u3066\u914d\u5217\u306b\u683c\u7d0d $csv_line = \"\u7530\u4e2d,\u5c71\u7530,\u4f50\u85e4\"; $names = explode(\",\", $csv_line); \/\/ [\"\u7530\u4e2d\", \"\u5c71\u7530\", \"\u4f50\u85e4\"]<\/code><\/li>\n\n\n\n<li><strong>\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u3088\u308b\u62bd\u51fa<\/strong>\uff1a \u6b63\u898f\u8868\u73fe\u306a\u3069\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002 <code>\/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u62bd\u51fa\u3059\u308b\u4f8b $text = \"\u304a\u554f\u3044\u5408\u308f\u305b\u306finfo@example.com\u307e\u3067\u3069\u3046\u305e\"; preg_match('\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/', $text, $matches); $email = $matches[0]; \/\/ \"info@example.com\"<\/code><\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u306f\u3001\u5358\u72ec\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3001\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u6700\u9069\u306a\u65b9\u6cd5\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3001\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3078\u306e\u7b2c\u4e00\u6b69\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>PHP\u3067\u306f\u6587\u5b57\u5217\u306f\u300c0\u300d\u304b\u3089\u59cb\u307e\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u3001\u5404\u6587\u5b57\u304c\u30e1\u30e2\u30ea\u4e0a\u306e\u9023\u7d9a\u3057\u305f\u9818\u57df\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3092\u6271\u3046\u5834\u5408\u306f\u7279\u5225\u306a\u914d\u616e\u304c\u5fc5\u8981\u3067\u3001\u3053\u306e\u70b9\u306b\u3064\u3044\u3066\u306f\u5f8c\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u57fa\u672c\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u95a2\u6570\u3068\u305d\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u3001\u3088\u308a\u8a73\u7d30\u306b\u6398\u308a\u4e0b\u3052\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-3\">\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u95a2\u6570\u306e\u5fb9\u5e95\u89e3\u8aac<\/h2>\n\n\n\n<p>PHP\u306b\u306f\u6587\u5b57\u5217\u304b\u3089\u5fc5\u8981\u306a\u90e8\u5206\u3092\u62bd\u51fa\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u95a2\u6570\u7fa4\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u9069\u5207\u306b\u7406\u89e3\u3057\u4f7f\u3044\u3053\u306a\u3059\u3053\u3068\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306e\u52b9\u7387\u3068\u7cbe\u5ea6\u304c\u5927\u5e45\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u6700\u3082\u57fa\u672c\u7684\u304b\u3064\u983b\u7e41\u306b\u4f7f\u7528\u3055\u308c\u308b\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u95a2\u6570\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">substr()\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3068\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u610f\u5473<\/h3>\n\n\n\n<p><code>substr()<\/code>\u95a2\u6570\u306f\u3001PHP\u3067\u6700\u3082\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u95a2\u6570\u3067\u3059\u3002\u6307\u5b9a\u3057\u305f\u958b\u59cb\u4f4d\u7f6e\u304b\u3089\u7279\u5b9a\u306e\u9577\u3055\u306e\u90e8\u5206\u6587\u5b57\u5217\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u69cb\u6587<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6587\u5b57\u5217\u306e\u5206\u89e3\u3068\u518d\u69cb\u7bc9\u306b\u3088\u308b\u5358\u8a9e\u306e\u5148\u982d\u6587\u5b57\u3092\u5927\u6587\u5b57\u5316\n$sentence = \"this is a sample sentence\";\n$words = explode(\" \", $sentence);\n\nforeach ($words as &amp;$word) {\n    $word = ucfirst($word); \/\/ \u5404\u5358\u8a9e\u306e\u5148\u982d\u3092\u5927\u6587\u5b57\u306b\n}\n\n$capitalized = implode(\" \", $words);\necho $capitalized; \/\/ \"This Is A Sample Sentence\"\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u3053\u3068\u3067\u3001\u6587\u5b57\u5217\u306e\u5206\u5272\u3084\u7d50\u5408\u3068\u3044\u3063\u305f\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u3092\u52b9\u7387\u7684\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u7279\u306bWeb\u958b\u767a\u3067\u306f\u3001\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3084CSV\u30d5\u30a1\u30a4\u30eb\u306e\u89e3\u6790\u3001URL\u306e\u30d1\u30fc\u30b9\u3001\u30c7\u30fc\u30bf\u306e\u6574\u5f62\u306a\u3069\u3001\u69d8\u3005\u306a\u5834\u9762\u3067\u3053\u308c\u3089\u306e\u95a2\u6570\u304c\u6d3b\u8e8d\u3057\u307e\u3059\u3002php substr(string $string, int $offset, ?int $length = null): string<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\n**\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a73\u7d30**:\n- `$string`: \u5bfe\u8c61\u3068\u306a\u308b\u6587\u5b57\u5217\n- `$offset`: \u5207\u308a\u51fa\u3057\u3092\u958b\u59cb\u3059\u308b\u4f4d\u7f6e\n  - \u6b63\u306e\u5024: \u6587\u5b57\u5217\u306e\u5148\u982d\uff080\uff09\u304b\u3089\u6570\u3048\u305f\u4f4d\u7f6e\n  - \u8ca0\u306e\u5024: \u6587\u5b57\u5217\u306e\u672b\u5c3e\u304b\u3089\u6570\u3048\u305f\u4f4d\u7f6e\uff08-1\u306f\u6700\u5f8c\u306e\u6587\u5b57\uff09\n- `$length`: \u5207\u308a\u51fa\u3059\u6587\u5b57\u6570\uff08\u7701\u7565\u53ef\u80fd\uff09\n  - \u6b63\u306e\u5024: \u6307\u5b9a\u3057\u305f\u6587\u5b57\u6570\u3092\u5207\u308a\u51fa\u3059\n  - \u8ca0\u306e\u5024: \u6587\u5b57\u5217\u306e\u672b\u5c3e\u304b\u3089\u305d\u306e\u6587\u5b57\u6570\u3092\u9664\u3044\u305f\u90e8\u5206\u3092\u5207\u308a\u51fa\u3059\n  - \u7701\u7565: offset\u304b\u3089\u6587\u5b57\u5217\u306e\u672b\u5c3e\u307e\u3067\u3059\u3079\u3066\u5207\u308a\u51fa\u3059\n\n**\u4f7f\u7528\u4f8b**:\n```php\n$text = \"PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\";\n\n\/\/ \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\uff08\u5148\u982d\u304b\u30893\u6587\u5b57\uff09\n$result1 = substr($text, 0, 3);\necho $result1; \/\/ \"PHP\"\n\n\/\/ \u958b\u59cb\u4f4d\u7f6e\u3092\u6307\u5b9a\uff084\u6587\u5b57\u76ee\u304b\u30893\u6587\u5b57\uff09\n$result2 = substr($text, 3, 3);\necho $result2; \/\/ \"\u30d7\u30ed\"\uff08\u203b\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u4eee\u5b9a\u3057\u305f\u5834\u5408\uff09\n\n\/\/ \u8ca0\u306e\u958b\u59cb\u4f4d\u7f6e\uff08\u5f8c\u308d\u304b\u30895\u6587\u5b57\u76ee\u304b\u30892\u6587\u5b57\uff09\n$result3 = substr($text, -5, 2);\necho $result3; \/\/ \"\u30b0\u30e9\"\uff08\u203b\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u4eee\u5b9a\u3057\u305f\u5834\u5408\uff09\n\n\/\/ \u9577\u3055\u3092\u7701\u7565\uff08\u6307\u5b9a\u4f4d\u7f6e\u304b\u3089\u672b\u5c3e\u307e\u3067\uff09\n$result4 = substr($text, 3);\necho $result4; \/\/ \"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\"\uff08\u203b\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u4eee\u5b9a\u3057\u305f\u5834\u5408\uff09\n\n\/\/ \u8ca0\u306e\u9577\u3055\uff08\u672b\u5c3e\u304b\u30893\u6587\u5b57\u3092\u9664\u304f\uff09\n$result5 = substr($text, 0, -3);\necho $result5; \/\/ \"PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\"\uff08\u203b\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u4eee\u5b9a\u3057\u305f\u5834\u5408\uff09\n<\/pre>\n\n\n\n<p><strong>\u6ce8\u610f\u70b9<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>substr()<\/code>\u306f\u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u51e6\u7406\u3059\u308b\u305f\u3081\u3001<strong>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3067\u306f\u4e88\u671f\u3057\u306a\u3044\u7d50\u679c\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059<\/strong>\u3002\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u306f\u5f8c\u8ff0\u306e<code>mb_substr()<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n\n\n\n<li>\u6307\u5b9a\u3057\u305f\u7bc4\u56f2\u304c\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8d85\u3048\u308b\u5834\u5408\u306f\u3001\u5229\u7528\u53ef\u80fd\u306a\u6700\u5927\u7bc4\u56f2\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">\u90e8\u5206\u6587\u5b57\u5217\u306e\u53d6\u5f97\u306b\u5f79\u7acb\u3064strpos()\u3068strrpos()\u306e\u6d3b\u7528\u6cd5<\/h3>\n\n\n\n<p>\u6587\u5b57\u5217\u3092\u5207\u308a\u51fa\u3059\u969b\u306b\u3001\u7279\u5b9a\u306e\u6587\u5b57\u3084\u6587\u5b57\u5217\u306e\u4f4d\u7f6e\u3092\u57fa\u6e96\u306b\u3057\u305f\u3044\u30b1\u30fc\u30b9\u306f\u591a\u3005\u3042\u308a\u307e\u3059\u3002<code>strpos()<\/code>\u3068<code>strrpos()<\/code>\u306f\u3001\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u529b\u3092\u767a\u63ee\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>strpos()<\/strong>: \u6587\u5b57\u5217\u5185\u3067\u7279\u5b9a\u306e\u6587\u5b57\u5217\u304c\u6700\u521d\u306b\u73fe\u308c\u308b\u4f4d\u7f6e\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">strpos(string $haystack, string $needle, int $offset = 0): int|false\n<\/pre>\n\n\n\n<p><strong>strrpos()<\/strong>: \u6587\u5b57\u5217\u5185\u3067\u7279\u5b9a\u306e\u6587\u5b57\u5217\u304c\u6700\u5f8c\u306b\u73fe\u308c\u308b\u4f4d\u7f6e\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">strrpos(string $haystack, string $needle, int $offset = 0): int|false\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u8a73\u7d30<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$haystack<\/code>: \u691c\u7d22\u5bfe\u8c61\u306e\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$needle<\/code>: \u691c\u7d22\u3059\u308b\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$offset<\/code>: \u691c\u7d22\u3092\u958b\u59cb\u3059\u308b\u4f4d\u7f6e\uff08\u7701\u7565\u6642\u306f\u5148\u982d\u304b\u3089\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>\u623b\u308a\u5024<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u898b\u3064\u304b\u3063\u305f\u5834\u5408: \u6587\u5b57\u5217\u5185\u306e\u4f4d\u7f6e\uff080\u304b\u3089\u59cb\u307e\u308b\uff09<\/li>\n\n\n\n<li>\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408: <code>false<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>\u6d3b\u7528\u4f8b<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$email = \"user.name@example.com\";\n\n\/\/ @\u306e\u4f4d\u7f6e\u3092\u691c\u7d22\n$atPos = strpos($email, \"@\");\necho \"@ \u306e\u4f4d\u7f6e: \" . $atPos . \"\\n\"; \/\/ \"@ \u306e\u4f4d\u7f6e: 9\"\n\n\/\/ @\u3088\u308a\u524d\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u90e8\u5206\u3092\u53d6\u5f97\n$username = substr($email, 0, $atPos);\necho \"\u30e6\u30fc\u30b6\u30fc\u540d: \" . $username . \"\\n\"; \/\/ \"\u30e6\u30fc\u30b6\u30fc\u540d: user.name\"\n\n\/\/ @\u3088\u308a\u5f8c\u306e\u30c9\u30e1\u30a4\u30f3\u90e8\u5206\u3092\u53d6\u5f97\n$domain = substr($email, $atPos + 1);\necho \"\u30c9\u30e1\u30a4\u30f3: \" . $domain . \"\\n\"; \/\/ \"\u30c9\u30e1\u30a4\u30f3: example.com\"\n\n\/\/ \u6700\u5f8c\u306e\u30d4\u30ea\u30aa\u30c9\u306e\u4f4d\u7f6e\u3092\u691c\u7d22\n$lastDotPos = strrpos($email, \".\");\necho \"\u6700\u5f8c\u306e\u30d4\u30ea\u30aa\u30c9\u306e\u4f4d\u7f6e: \" . $lastDotPos . \"\\n\"; \/\/ \"\u6700\u5f8c\u306e\u30d4\u30ea\u30aa\u30c9\u306e\u4f4d\u7f6e: 17\"\n\n\/\/ \u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30c9\u30e1\u30a4\u30f3\u3092\u53d6\u5f97\n$tld = substr($email, $lastDotPos + 1);\necho \"TLD: \" . $tld . \"\\n\"; \/\/ \"TLD: com\"\n<\/pre>\n\n\n\n<p><strong>\u6ce8\u610f\u70b9\u3068\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>strpos()<\/code>\u304c<code>0<\/code>\u3092\u8fd4\u3059\u5834\u5408\uff08\u5148\u982d\u3067\u898b\u3064\u304b\u3063\u305f\u5834\u5408\uff09\u3068<code>false<\/code>\u3092\u8fd4\u3059\u5834\u5408\uff08\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\uff09\u3092\u533a\u5225\u3059\u308b\u305f\u3081\u306b\u3001<code>===<\/code>\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$text = \"PHP\u6587\u5b57\u5217\u64cd\u4f5c\";\n$pos = strpos($text, \"PHP\");\n\n\/\/ \u6b63\u3057\u3044\u6761\u4ef6\u5224\u5b9a\nif ($pos !== false) {\n    echo \"\u898b\u3064\u304b\u308a\u307e\u3057\u305f\uff08\u4f4d\u7f6e: $pos\uff09\";\n} else {\n    echo \"\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\";\n}\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>strpos()<\/code>\u3068<code>substr()<\/code>\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u52d5\u7684\u306a\u6587\u5b57\u5217\u62bd\u51fa\u3092\u884c\u3046\u969b\u306e\u30d1\u30bf\u30fc\u30f3:<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function extractBetween($string, $start, $end) {\n    $startPos = strpos($string, $start);\n    \n    \/\/ \u958b\u59cb\u6587\u5b57\u5217\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\n    if ($startPos === false) {\n        return false;\n    }\n    \n    $startPos += strlen($start); \/\/ \u958b\u59cb\u6587\u5b57\u5217\u306e\u76f4\u5f8c\u304b\u3089\n    $endPos = strpos($string, $end, $startPos);\n    \n    \/\/ \u7d42\u4e86\u6587\u5b57\u5217\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\n    if ($endPos === false) {\n        return false;\n    }\n    \n    return substr($string, $startPos, $endPos - $startPos);\n}\n\n\/\/ \u4f7f\u7528\u4f8b: HTML\u30bf\u30b0\u9593\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u62bd\u51fa\n$html = \"&lt;div&gt;\u3053\u308c\u306f&lt;span&gt;\u30b5\u30f3\u30d7\u30eb&lt;\/span&gt;\u30c6\u30ad\u30b9\u30c8\u3067\u3059&lt;\/div&gt;\";\n$content = extractBetween($html, \"&lt;span&gt;\", \"&lt;\/span&gt;\");\necho $content; \/\/ \"\u30b5\u30f3\u30d7\u30eb\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">explode()\u3068implode()\u3092\u4f7f\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u5206\u5272\u3068\u7d50\u5408\u306e\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p><code>explode()<\/code>\u3068<code>implode()<\/code>\u306f\u3001\u533a\u5207\u308a\u6587\u5b57\u3092\u57fa\u6e96\u306b\u3057\u305f\u6587\u5b57\u5217\u306e\u5206\u5272\u3068\u7d50\u5408\u3092\u884c\u3046\u95a2\u6570\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u3067\u306f\u975e\u5e38\u306b\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>explode()<\/strong>: \u6587\u5b57\u5217\u3092\u533a\u5207\u308a\u6587\u5b57\u3067\u5206\u5272\u3057\u3001\u914d\u5217\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">explode(string $separator, string $string, int $limit = PHP_INT_MAX): array\n<\/pre>\n\n\n\n<p><strong>implode()<\/strong>: \u914d\u5217\u306e\u8981\u7d20\u3092\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u3067\u9023\u7d50\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">implode(string $separator, array $array): string\n\/\/ \u307e\u305f\u306f join() \u3068\u3044\u3046\u5225\u540d\u3067\u3082\u4f7f\u3048\u307e\u3059\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u4f7f\u7528\u4f8b<\/strong>:<\/p>\n\n\n\n<p>**explode()**\u306e\u4f8b:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ CSV\u30c7\u30fc\u30bf\u306e\u5206\u5272\n$csvLine = \"PHP,Python,JavaScript,Ruby\";\n$languages = explode(\",\", $csvLine);\n\necho \"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u4e00\u89a7\uff1a\\n\";\nforeach ($languages as $index =&gt; $lang) {\n    echo ($index + 1) . \". \" . $lang . \"\\n\";\n}\n\/\/ \u51fa\u529b:\n\/\/ \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u4e00\u89a7\uff1a\n\/\/ 1. PHP\n\/\/ 2. Python\n\/\/ 3. JavaScript\n\/\/ 4. Ruby\n\n\/\/ limit \u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6d3b\u7528\n$path = \"\/usr\/local\/bin\/php\";\n$parts = explode(\"\/\", $path, 3);\n\/\/ $parts = [0 =&gt; \"\", 1 =&gt; \"usr\", 2 =&gt; \"local\/bin\/php\"]\n\n\/\/ \u6700\u5f8c\u306e\u8981\u7d20\u3060\u3051\u3092\u53d6\u5f97\n$filename = explode(\"\/\", $path);\n$filename = end($filename); \/\/ \"php\"\n<\/pre>\n\n\n\n<p>**implode()**\u306e\u4f8b:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u914d\u5217\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\n$fruits = [\"\u308a\u3093\u3054\", \"\u30d0\u30ca\u30ca\", \"\u30aa\u30ec\u30f3\u30b8\"];\n$list = implode(\"\u3001\", $fruits);\necho $list; \/\/ \"\u308a\u3093\u3054\u3001\u30d0\u30ca\u30ca\u3001\u30aa\u30ec\u30f3\u30b8\"\n\n\/\/ SQL\u306eIN\u53e5\u306e\u69cb\u7bc9\n$ids = [1, 5, 9, 12];\n$inClause = \"(\" . implode(\",\", $ids) . \")\";\necho $inClause; \/\/ \"(1,5,9,12)\"\n\n\/\/ \u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u306e\u751f\u6210\n$breadcrumbs = [\"\u30db\u30fc\u30e0\", \"\u88fd\u54c1\", \"\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\"];\n$breadcrumbsHtml = implode(\" &amp;gt; \", $breadcrumbs);\necho $breadcrumbsHtml; \/\/ \"\u30db\u30fc\u30e0 &amp;gt; \u88fd\u54c1 &amp;gt; \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\"\n<\/pre>\n\n\n\n<p><strong>\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6587\u5b57\u5217\u306e\u5206\u5272\u3068\u518d\u7d50\u5408\u306b\u3088\u308b\u7f6e\u63db<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u533a\u5207\u3089\u308c\u305f\u6587\u5b57\u5217\u3067\u3001\u4e00\u90e8\u306e\u8981\u7d20\u3060\u3051\u3092\u5909\u66f4\n$text = \"name=John|age=30|city=New York\";\n$parts = explode(\"|\", $text);\n\n\/\/ \u5e74\u9f62\u306e\u90e8\u5206\u3060\u3051\u3092\u5909\u66f4\nforeach ($parts as $key =&gt; $part) {\n    if (strpos($part, \"age=\") === 0) {\n        $parts[$key] = \"age=31\";\n    }\n}\n\n$newText = implode(\"|\", $parts);\necho $newText; \/\/ \"name=John|age=31|city=New York\"\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>explode()\u3068array_slice()\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ URL\u306e\u30d1\u30b9\u90e8\u5206\u3092\u53d6\u5f97\u3057\u3066\u672b\u5c3e\u306en\u500b\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u3092\u53d6\u5f97\n$url = \"https:\/\/example.com\/products\/category\/item\";\n$urlParts = parse_url($url);\n$pathSegments = explode(\"\/\", $urlParts[\"path\"]);\n\n\/\/ \u6700\u5f8c\u306e2\u3064\u306e\u30bb\u30b0\u30e1\u30f3\u30c8\u3092\u53d6\u5f97\n$lastSegments = array_slice($pathSegments, -2);\necho implode(\"\/\", $lastSegments); \/\/ \"category\/item\"\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u6587\u5b57\u5217\u306e\u5206\u89e3\u3068\u518d\u69cb\u7bc9<\/strong>:<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-7\">\u65e5\u672c\u8a9e\u306a\u3069\u591a\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u5b89\u5168\u306b\u51e6\u7406\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>PHP\u3067\u65e5\u672c\u8a9e\u3084\u305d\u306e\u4ed6\u306e\u975eASCII\u6587\u5b57\uff08\u4e2d\u56fd\u8a9e\u3001\u97d3\u56fd\u8a9e\u3001\u7d75\u6587\u5b57\u306a\u3069\uff09\u3092\u6271\u3046\u5834\u5408\u3001\u901a\u5e38\u306e\u6587\u5b57\u5217\u95a2\u6570\u3067\u306f\u6b63\u3057\u304f\u51e6\u7406\u3067\u304d\u306a\u3044\u30b1\u30fc\u30b9\u304c\u591a\u3005\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3053\u308c\u3089\u306e\u6587\u5b57\u304c\u300c\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u300d\u3067\u3042\u308b\u305f\u3081\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u5b89\u5168\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u77e5\u8b58\u3068\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u51e6\u7406\u306e\u843d\u3068\u3057\u7a74\u3068\u5bfe\u51e6\u6cd5<\/h3>\n\n\n\n<p>\u307e\u305a\u3001\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306e\u9055\u3044\u3092\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<p><strong>\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30c8\u6587\u5b57<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1\u6587\u5b57\u304c1\u30d0\u30a4\u30c8\u3067\u8868\u73fe\u3055\u308c\u308b\uff08\u82f1\u6570\u5b57\u3001\u57fa\u672c\u7684\u306a\u8a18\u53f7\u306a\u3069\uff09<\/li>\n\n\n\n<li>\u4f8b\uff1aASCII\u6587\u5b57\u30bb\u30c3\u30c8\uff08A-Z, a-z, 0-9, \u8a18\u53f7\u985e\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1\u6587\u5b57\u306e\u8868\u73fe\u306b\u8907\u6570\u306e\u30d0\u30a4\u30c8\u3092\u4f7f\u7528\uff08\u65e5\u672c\u8a9e\u3001\u4e2d\u56fd\u8a9e\u3001\u7d75\u6587\u5b57\u306a\u3069\uff09<\/li>\n\n\n\n<li>\u4f8b\uff1aUTF-8\u3067\u306e\u65e5\u672c\u8a9e\uff081\u6587\u5b57\u3042\u305f\u308a3\u30d0\u30a4\u30c8\uff09\u3001\u7d75\u6587\u5b57\uff084\u30d0\u30a4\u30c8\uff09<\/li>\n<\/ul>\n\n\n\n<p>PHP\u306e\u6a19\u6e96\u6587\u5b57\u5217\u95a2\u6570\uff08<code>substr()<\/code>, <code>strlen()<\/code>, <code>strpos()<\/code>\u306a\u3069\uff09\u306f<strong>\u30d0\u30a4\u30c8\u5358\u4f4d<\/strong>\u3067\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u969b\u306b\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001\u6a19\u6e96\u95a2\u6570\u3067\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u51e6\u7406\u3057\u305f\u5834\u5408\u306e\u554f\u984c\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$text = \"\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\"; \/\/ UTF-8\u30a8\u30f3\u30b3\u30fc\u30c9\u306e\u65e5\u672c\u8a9e\u6587\u5b57\u5217\n\n\/\/ \u30d0\u30a4\u30c8\u6570\u3092\u53d6\u5f97 (\u6587\u5b57\u6570\u3067\u306f\u306a\u3044)\necho strlen($text); \/\/ 21 (7\u6587\u5b57\u00d73\u30d0\u30a4\u30c8)\n\n\/\/ \u30d0\u30a4\u30c8\u5358\u4f4d\u30673\u30d0\u30a4\u30c8\u5206\u3092\u5207\u308a\u51fa\u3059\n$substring = substr($text, 0, 3);\necho $substring; \/\/ \"\u3053\" (1\u6587\u5b57\u3060\u3051\u53d6\u5f97\u3055\u308c\u308b)\n\n\/\/ 4\u30d0\u30a4\u30c8\u76ee\u304b\u30893\u30d0\u30a4\u30c8\u5206\u3092\u5207\u308a\u51fa\u3059\n$broken = substr($text, 3, 3);\necho $broken; \/\/ \u6587\u5b57\u5316\u3051\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b (1\u6587\u5b57\u306e\u9014\u4e2d\u304b\u3089\u5207\u308a\u51fa\u3059\u305f\u3081)\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u306b\u3001PHP\u306b\u306f<strong>mb_string\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb<\/strong>\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u306f\u306a\u304f\u6587\u5b57\u5358\u4f4d\u3067\u51e6\u7406\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">mb_substr()\u95a2\u6570\u3092\u4f7f\u3063\u305f\u6b63\u78ba\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057<\/h3>\n\n\n\n<p><code>mb_substr()<\/code>\u95a2\u6570\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u304b\u3089\u6307\u5b9a\u3057\u305f\u7bc4\u56f2\u306e\u90e8\u5206\u6587\u5b57\u5217\u3092\u9069\u5207\u306b\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u95a2\u6570\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u69cb\u6587<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mb_substr(string $string, int $start, ?int $length = null, ?string $encoding = null): string\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$string<\/code>: \u5bfe\u8c61\u3068\u306a\u308b\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$start<\/code>: \u958b\u59cb\u4f4d\u7f6e\uff08\u6587\u5b57\u5358\u4f4d\u3001\u8ca0\u306e\u5024\u306f\u672b\u5c3e\u304b\u3089\u30ab\u30a6\u30f3\u30c8\uff09<\/li>\n\n\n\n<li><code>$length<\/code>: \u53d6\u5f97\u3059\u308b\u6587\u5b57\u6570\uff08\u7701\u7565\u6642\u306f\u6700\u5f8c\u307e\u3067\uff09<\/li>\n\n\n\n<li><code>$encoding<\/code>: \u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff08\u7701\u7565\u6642\u306f\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4f7f\u7528\u4f8b<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$text = \"\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\";\n\n\/\/ \u6587\u5b57\u6570\u3092\u6b63\u78ba\u306b\u53d6\u5f97\necho mb_strlen($text); \/\/ 7\n\n\/\/ \u5148\u982d\u304b\u30893\u6587\u5b57\u3092\u53d6\u5f97\n$hello = mb_substr($text, 0, 3);\necho $hello; \/\/ \"\u3053\u3093\u306b\"\n\n\/\/ 4\u6587\u5b57\u76ee\u304b\u30892\u6587\u5b57\u3092\u53d6\u5f97\n$world = mb_substr($text, 3, 2);\necho $world; \/\/ \"\u3061\u306f\"\n\n\/\/ \u672b\u5c3e\u304b\u30892\u6587\u5b57\u3092\u53d6\u5f97\n$end = mb_substr($text, -2);\necho $end; \/\/ \"\u4e16\u754c\"\n<\/pre>\n\n\n\n<p>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u4ed6\u306e\u4e3b\u8981\u306a\u95a2\u6570\u3082\u540c\u69d8\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$text = \"\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\";\n\n\/\/ \u6587\u5b57\u4f4d\u7f6e\u3092\u691c\u7d22\n$pos = mb_strpos($text, \"\u306f\");\necho \"\u300c\u306f\u300d\u306e\u4f4d\u7f6e: \" . $pos . \"\\n\"; \/\/ 4\n\n\/\/ \u5927\u6587\u5b57\u5c0f\u6587\u5b57\u5909\u63db\uff08\u3072\u3089\u304c\u306a\u2192\u30ab\u30bf\u30ab\u30ca\u5909\u63db\u3082\u53ef\u80fd\uff09\n$katakana = mb_convert_kana($text, \"K\");\necho $katakana; \/\/ \"\u30b3\u30f3\u30cb\u30c1\u30cf\u4e16\u754c\"\n\n\/\/ \u6587\u5b57\u5217\u3092\u914d\u5217\u306b\u5206\u5272\n$chars = mb_str_split($text);\nprint_r($chars); \/\/ [\"\u3053\", \"\u3093\", \"\u306b\", \"\u3061\", \"\u306f\", \"\u4e16\", \"\u754c\"]\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8003\u616e\u3057\u305f\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u969b\u306b\u6700\u3082\u91cd\u8981\u306a\u306e\u306f\u3001<strong>\u4e00\u8cab\u3057\u305f\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<\/strong>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6587\u5b57\u30b3\u30fc\u30c9\u304c\u6df7\u5728\u3059\u308b\u3068\u3001\u6587\u5b57\u5316\u3051\u3084\u30c7\u30fc\u30bf\u640d\u5931\u306e\u539f\u56e0\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>PHP\u3067\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/strong>\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>php.ini\u3067\u306e\u8a2d\u5b9a<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">default_charset = \"UTF-8\"\nmbstring.internal_encoding = \"UTF-8\"\nmbstring.http_output = \"UTF-8\"\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u3067\u306e\u8a2d\u5b9a<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5148\u982d\u3067\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\nmb_internal_encoding('UTF-8');\nmb_http_output('UTF-8');\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>HTML\u30d8\u30c3\u30c0\u30fc\u3067\u306e\u8a2d\u5b9a<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">header('Content-Type: text\/html; charset=UTF-8');\n<\/pre>\n\n\n\n<p><strong>\u5b9f\u8df5\u7684\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u5bfe\u5fdc\u30c6\u30af\u30cb\u30c3\u30af<\/strong>\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5165\u529b\u30c7\u30fc\u30bf\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u691c\u8a3c\u3068\u5909\u63db<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function sanitizeInput($input) {\n    \/\/ \u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u691c\u51fa\n    $detected = mb_detect_encoding($input, ['UTF-8', 'SJIS', 'EUC-JP'], true);\n    \n    \/\/ \u691c\u51fa\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u8a2d\u5b9a\n    if (!$detected) {\n        $detected = 'UTF-8';\n    }\n    \n    \/\/ \u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3078\u5909\u63db\n    if ($detected !== 'UTF-8') {\n        return mb_convert_encoding($input, 'UTF-8', $detected);\n    }\n    \n    return $input;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$userInput = $_POST['message'];\n$cleanInput = sanitizeInput($userInput);\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u9023\u643a\u6642\u306e\u6ce8\u610f\u70b9<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ MySQL\u306e\u63a5\u7d9a\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u8a2d\u5b9a\n$pdo = new PDO('mysql:host=localhost;dbname=test;charset=utf8mb4', 'username', 'password');\n\n\/\/ \u307e\u305f\u306f\u65e2\u5b58\u306e\u63a5\u7d9a\u306b\u8a2d\u5b9a\n$pdo-&gt;exec(\"SET NAMES utf8mb4\");\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u66f8\u304d\u6642\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8003\u616e<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u6642\u306b\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u691c\u51fa\u3057\u3066\u5909\u63db\nfunction readFileWithEncoding($filename, $targetEncoding = 'UTF-8') {\n    $content = file_get_contents($filename);\n    $detected = mb_detect_encoding($content, ['UTF-8', 'SJIS', 'EUC-JP'], true);\n    \n    if ($detected &amp;&amp; $detected !== $targetEncoding) {\n        $content = mb_convert_encoding($content, $targetEncoding, $detected);\n    }\n    \n    return $content;\n}\n\n\/\/ \u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u8fbc\u307f\u6642\u306bBOM\u3092\u4ed8\u3051\u306a\u3044\u65b9\u6cd5\nfunction writeUtf8File($filename, $content) {\n    \/\/ UTF-8\u30a8\u30f3\u30b3\u30fc\u30c9\u306b\u5909\u63db\n    $utf8Content = mb_convert_encoding($content, 'UTF-8');\n    \n    \/\/ BOM\u30c1\u30a7\u30c3\u30af\u3068\u524a\u9664\n    if (substr($utf8Content, 0, 3) === \"\\xEF\\xBB\\xBF\") {\n        $utf8Content = substr($utf8Content, 3);\n    }\n    \n    file_put_contents($filename, $utf8Content);\n}\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306eURL\u51e6\u7406<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ URL\u30a8\u30f3\u30b3\u30fc\u30c9\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\uff09\n$japaneseKeyword = \"\u65e5\u672c\u8a9e\u691c\u7d22\";\n$encodedKeyword = rawurlencode($japaneseKeyword);\n$url = \"https:\/\/example.com\/search?q=\" . $encodedKeyword;\n\n\/\/ URL\u30c7\u30b3\u30fc\u30c9\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\uff09\n$decodedKeyword = rawurldecode($_GET['q']);\n<\/pre>\n\n\n\n<p><strong>\u307e\u3068\u3081\u3068\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/strong>\uff1a<\/p>\n\n\n\n<p>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u969b\u306f\u3001\u4ee5\u4e0b\u306e\u539f\u5247\u3092\u5b88\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5e38\u306b<code>mb_*<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u6587\u5b57\u5358\u4f4d\u306e\u51e6\u7406\u3092\u884c\u3046<\/li>\n\n\n\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5168\u4f53\u3067\u4e00\u8cab\u3057\u305f\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff08\u3067\u304d\u308c\u3070UTF-8\uff09\u3092\u4f7f\u7528\u3059\u308b<\/li>\n\n\n\n<li>\u5916\u90e8\u304b\u3089\u306e\u5165\u529b\u30c7\u30fc\u30bf\u306f\u5fc5\u305a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30c1\u30a7\u30c3\u30af\u3068\u5909\u63db\u3092\u884c\u3046<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u3068\u306e\u3084\u308a\u53d6\u308a\u3067\u3082\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u7d71\u4e00\u3059\u308b<\/li>\n\n\n\n<li>HTML\u51fa\u529b\u6642\u306b\u306fContent-Type\u30d8\u30c3\u30c0\u30fc\u3068\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a\u3092\u5fd8\u308c\u306a\u3044<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001PHP\u3067\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3092\u5b89\u5168\u304b\u3064\u6b63\u78ba\u306b\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u8fd1\u5e74\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u30b0\u30ed\u30fc\u30d0\u30eb\u5bfe\u5fdc\u304c\u6c42\u3081\u3089\u308c\u308b\u305f\u3081\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u51e6\u7406\u306e\u30b9\u30ad\u30eb\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-11\">\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\uff08Regular Expression\u3001\u7565\u3057\u3066Regex\uff09\u306f\u3001\u6587\u5b57\u5217\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u691c\u7d22\u30fb\u62bd\u51fa\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u95a2\u6570\u3067\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u53ef\u80fd\u306b\u3057\u3001\u30b3\u30fc\u30c9\u306e\u52b9\u7387\u5316\u3068\u67d4\u8edf\u6027\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002PHP\u306f\u8c4a\u5bcc\u306a\u6b63\u898f\u8868\u73fe\u95a2\u6570\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001\u3053\u308c\u3089\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u3053\u3068\u3067\u6587\u5b57\u5217\u51e6\u7406\u306e\u53ef\u80fd\u6027\u304c\u683c\u6bb5\u306b\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">preg_match()\u3068preg_match_all()\u306b\u3088\u308b\u67d4\u8edf\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h3>\n\n\n\n<p>PHP\u3067\u6b63\u898f\u8868\u73fe\u3092\u6271\u3046\u4e3b\u8981\u306a\u95a2\u6570\u306f<code>preg_match()<\/code>\u3068<code>preg_match_all()<\/code>\u3067\u3059\u3002\u3053\u308c\u3089\u306fPCRE\uff08Perl Compatible Regular Expressions\uff09\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3001\u300c\/\u300d\uff08\u30c7\u30ea\u30df\u30bf\uff09\u3067\u56f2\u307e\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>preg_match()<\/strong>: \u30d1\u30bf\u30fc\u30f3\u304c\u6700\u521d\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int preg_match(string $pattern, string $subject, array &amp;$matches = null, int $flags = 0, int $offset = 0)\n<\/pre>\n\n\n\n<p><strong>preg_match_all()<\/strong>: \u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u90e8\u5206\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int preg_match_all(string $pattern, string $subject, array &amp;$matches = null, int $flags = 0, int $offset = 0)\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ preg_match() - \u6700\u521d\u306b\u4e00\u81f4\u3059\u308b\u3082\u306e\u3060\u3051\u3092\u53d6\u5f97\n$text = \"\u304a\u554f\u3044\u5408\u308f\u305b\u306finfo@example.com\u307e\u305f\u306fsupport@example.jp\u307e\u3067\";\n$pattern = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n\nif (preg_match($pattern, $text, $matches)) {\n    echo \"\u6700\u521d\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9: \" . $matches[0]; \/\/ \"info@example.com\"\n}\n\n\/\/ preg_match_all() - \u3059\u3079\u3066\u306e\u4e00\u81f4\u3092\u53d6\u5f97\nif (preg_match_all($pattern, $text, $matches)) {\n    echo \"\u898b\u3064\u304b\u3063\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u6570: \" . count($matches[0]) . \"\\n\";\n    foreach ($matches[0] as $email) {\n        echo \"- \" . $email . \"\\n\";\n    }\n}\n\/\/ \u51fa\u529b:\n\/\/ \u898b\u3064\u304b\u3063\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u6570: 2\n\/\/ - info@example.com\n\/\/ - support@example.jp\n<\/pre>\n\n\n\n<p><strong>\u90e8\u5206\u30d1\u30bf\u30fc\u30f3\u306e\u62bd\u51fa\uff08\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\uff09<\/strong>:<\/p>\n\n\n\n<p>\u62ec\u5f27<code>()<\/code>\u3092\u4f7f\u3063\u3066\u30d1\u30bf\u30fc\u30f3\u306e\u4e00\u90e8\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3068\u3001\u305d\u306e\u90e8\u5206\u3060\u3051\u3092\u500b\u5225\u306b\u62bd\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$log = \"2023-10-15 14:30:25 [ERROR] Database connection failed: timeout\";\n$pattern = '\/(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2}:\\d{2}) \\[(\\w+)\\] (.*)\/';\n\nif (preg_match($pattern, $log, $matches)) {\n    \/\/ $matches[0]\u306b\u306f\u4e00\u81f4\u3057\u305f\u6587\u5b57\u5217\u5168\u4f53\u304c\u5165\u308b\n    echo \"\u65e5\u4ed8: \" . $matches[1] . \"\\n\";     \/\/ 2023-10-15\n    echo \"\u6642\u523b: \" . $matches[2] . \"\\n\";     \/\/ 14:30:25\n    echo \"\u30ec\u30d9\u30eb: \" . $matches[3] . \"\\n\";   \/\/ ERROR\n    echo \"\u30e1\u30c3\u30bb\u30fc\u30b8: \" . $matches[4] . \"\\n\"; \/\/ Database connection failed: timeout\n}\n<\/pre>\n\n\n\n<p><strong>\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/strong>:<\/p>\n\n\n\n<p>\u3088\u308a\u8aad\u307f\u3084\u3059\u304f\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306e\u305f\u3081\u306b\u3001\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u306b\u540d\u524d\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$url = \"https:\/\/www.example.com\/products\/category\/item?id=123&amp;color=blue\";\n$pattern = '\/^(?P&lt;protocol&gt;https?):\\\/\\\/(?P&lt;domain&gt;[\\w.-]+)(?P&lt;path&gt;\\\/[\\w\\\/.-]*)?(?:\\?(?P&lt;query&gt;[\\w=&amp;]+))?$\/';\n\nif (preg_match($pattern, $url, $matches)) {\n    echo \"\u30d7\u30ed\u30c8\u30b3\u30eb: \" . $matches['protocol'] . \"\\n\";  \/\/ https\n    echo \"\u30c9\u30e1\u30a4\u30f3: \" . $matches['domain'] . \"\\n\";      \/\/ www.example.com\n    echo \"\u30d1\u30b9: \" . $matches['path'] . \"\\n\";            \/\/ \/products\/category\/item\n    echo \"\u30af\u30a8\u30ea: \" . $matches['query'] . \"\\n\";         \/\/ id=123&amp;color=blue\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u62bd\u51fa\u306b\u5f79\u7acb\u3064\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u5408\u81f4\u3059\u308b\u6587\u5b57\u5217\u3092\u62bd\u51fa\u3059\u308b\u30b7\u30ca\u30ea\u30aa\u304c\u983b\u7e41\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u3088\u304f\u4f7f\u308f\u308c\u308b\u5b9f\u7528\u7684\u306a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-14\">1. HTML\u304b\u3089\u306e\u7279\u5b9a\u8981\u7d20\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$html = '&lt;div class=\"content\"&gt;&lt;h1&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/h1&gt;&lt;p&gt;\u3053\u308c\u306f&lt;a href=\"https:\/\/example.com\"&gt;\u30ea\u30f3\u30af&lt;\/a&gt;\u3092\u542b\u3080\u6bb5\u843d\u3067\u3059\u3002&lt;\/p&gt;&lt;\/div&gt;';\n\n\/\/ h1\u30bf\u30b0\u306e\u5185\u5bb9\u3092\u62bd\u51fa\npreg_match('\/&lt;h1&gt;(.*?)&lt;\\\/h1&gt;\/', $html, $matches);\necho \"\u898b\u51fa\u3057: \" . $matches[1] . \"\\n\"; \/\/ \"\u30bf\u30a4\u30c8\u30eb\"\n\n\/\/ a\u30bf\u30b0\u306ehref\u5c5e\u6027\u5024\u3092\u62bd\u51fa\npreg_match('\/&lt;a\\s+[^&gt;]*href=[\"\\']([^\"\\']*)[\"\\'][^&gt;]*&gt;\/', $html, $matches);\necho \"\u30ea\u30f3\u30afURL: \" . $matches[1] . \"\\n\"; \/\/ \"https:\/\/example.com\"\n\n\/\/ \u3059\u3079\u3066\u306e\u30bf\u30b0\u3092\u9664\u53bb\u3057\u3066\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\n$plainText = preg_replace('\/&lt;[^&gt;]*&gt;\/', '', $html);\necho \"\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8: \" . $plainText . \"\\n\"; \/\/ \"\u30bf\u30a4\u30c8\u30eb\u3053\u308c\u306f\u30ea\u30f3\u30af\u3092\u542b\u3080\u6bb5\u843d\u3067\u3059\u3002\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-15\">2. \u6587\u7ae0\u304b\u3089\u306e\u7279\u5b9a\u60c5\u5831\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u672c\u306e\u90f5\u4fbf\u756a\u53f7\uff083\u6841-4\u6841\u5f62\u5f0f\uff09\u3092\u62bd\u51fa\n$address = \"\u3012123-4567 \u6771\u4eac\u90fd\u65b0\u5bbf\u533a\u897f\u65b0\u5bbf1-2-3 \u30b5\u30f3\u30d7\u30eb\u30d3\u30eb101\";\npreg_match('\/\u3012?\\s*(\\d{3}[-]\\d{4})\/', $address, $matches);\necho \"\u90f5\u4fbf\u756a\u53f7: \" . $matches[1] . \"\\n\"; \/\/ \"123-4567\"\n\n\/\/ \u96fb\u8a71\u756a\u53f7\u3092\u62bd\u51fa\uff08\u69d8\u3005\u306a\u5f62\u5f0f\u306b\u5bfe\u5fdc\uff09\n$contact = \"\u304a\u96fb\u8a71: 03-1234-5678 \u307e\u305f\u306f 090-1234-5678\u3001+81-80-1234-5678\";\npreg_match_all('\/(?:\\+\\d{1,4}[-\\s]?)?\\d{2,4}[-\\s]?\\d{2,4}[-\\s]?\\d{4}\/', $contact, $matches);\nprint_r($matches[0]); \/\/ [\"03-1234-5678\", \"090-1234-5678\", \"+81-80-1234-5678\"]\n\n\/\/ \u65e5\u4ed8\u5f62\u5f0f\u3092\u62bd\u51fa\uff08YYYY\/MM\/DD \u307e\u305f\u306f YYYY-MM-DD\uff09\n$text = \"\u30a4\u30d9\u30f3\u30c8\u306f2023\/10\/15\u304b\u30892023-12-31\u307e\u3067\u958b\u50ac\u3055\u308c\u307e\u3059\u3002\";\npreg_match_all('\/\\d{4}[-\\\/]\\d{1,2}[-\\\/]\\d{1,2}\/', $text, $matches);\nprint_r($matches[0]); \/\/ [\"2023\/10\/15\", \"2023-12-31\"]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-16\">3. \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u95a2\u9023\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP\u306e\u5909\u6570\u540d\u3092\u62bd\u51fa\n$code = '$firstName = \"John\"; $lastName = \"Doe\"; echo $firstName . \" \" . $lastName;';\npreg_match_all('\/\\$([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)\/', $code, $matches);\nprint_r($matches[1]); \/\/ [\"firstName\", \"lastName\", \"firstName\", \"lastName\"]\n\n\/\/ \u30b3\u30e1\u30f3\u30c8\u3092\u62bd\u51fa\n$phpCode = '\n\/\/ \u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8\n$x = 1; \/* \u8907\u6570\u884c\n\u30b3\u30e1\u30f3\u30c8 *\/\n# \u5225\u306e\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8\n';\npreg_match_all('\/(\\\/\\\/.*?$|\\\/\\*.*?\\*\\\/|#.*?$)\/ms', $phpCode, $matches);\nprint_r($matches[0]); \/\/ [\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8, \u8907\u6570\u884c\u30b3\u30e1\u30f3\u30c8, \u5225\u306e\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8]\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u969b\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u4e0d\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u6b63\u898f\u8868\u73fe\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-18\">1. \u6700\u9069\u306a\u30d1\u30bf\u30fc\u30f3\u9078\u629e<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u975e\u52b9\u7387\u306a\u4f8b\uff08\u904e\u5270\u306a\u5f8c\u65b9\u53c2\u7167\uff09\n$pattern1 = '\/(.*)@(.*)\\.(.*)\/';\n\n\/\/ \u52b9\u7387\u7684\u306a\u4f8b\uff08\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u8868\u73fe\uff09\n$pattern2 = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-19\">2. \u8caa\u6b32\uff08Greedy\uff09vs \u975e\u8caa\u6b32\uff08Non-greedy\uff09\u91cf\u6307\u5b9a\u5b50<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$html = '&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c41&lt;\/div&gt;&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c42&lt;\/div&gt;';\n\n\/\/ \u8caa\u6b32\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09- \u6700\u3082\u9577\u3044\u30de\u30c3\u30c1\u3092\u8fd4\u3059\npreg_match('\/&lt;div&gt;(.*)&lt;\\\/div&gt;\/', $html, $matches1);\necho $matches1[1] . \"\\n\"; \/\/ \"\u30b3\u30f3\u30c6\u30f3\u30c41&lt;\/div&gt;&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c42\"\n\n\/\/ \u975e\u8caa\u6b32\uff08?\u3092\u8ffd\u52a0\uff09- \u6700\u3082\u77ed\u3044\u30de\u30c3\u30c1\u3092\u8fd4\u3059\npreg_match('\/&lt;div&gt;(.*?)&lt;\\\/div&gt;\/', $html, $matches2);\necho $matches2[1] . \"\\n\"; \/\/ \"\u30b3\u30f3\u30c6\u30f3\u30c41\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-20\">3. \u4e0d\u8981\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u3092\u907f\u3051\u308b<\/h4>\n\n\n\n<p>\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u5fc5\u8981\u306a\u3044\u5834\u5408\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3057\u307e\u3059\u3002\u30b0\u30eb\u30fc\u30d7\u5316\u3060\u3051\u304c\u76ee\u7684\u306e\u5834\u5408\u306f\u975e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7 <code>(?:...)<\/code> \u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30ad\u30e3\u30d7\u30c1\u30e3\u3042\u308a - \u5404\u30de\u30c3\u30c1\u3054\u3068\u306b\u4f59\u5206\u306a\u30e1\u30e2\u30ea\u3092\u4f7f\u7528\n$pattern1 = '\/(https?):\\\/\\\/([\\w.-]+)\/';\n\/\/ \u30ad\u30e3\u30d7\u30c1\u30e3\u306a\u3057 - \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5411\u4e0a\n$pattern2 = '\/(?:https?):\\\/\\\/([\\w.-]+)\/';\n\n\/\/ \u5fc5\u8981\u306a\u90e8\u5206\u3060\u3051\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\npreg_match($pattern2, 'https:\/\/example.com', $matches);\necho $matches[1]; \/\/ \"example.com\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-21\">4. \u30a2\u30f3\u30ab\u30fc\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p>\u6587\u5b57\u5217\u306e\u5148\u982d<code>^<\/code>\u3084\u672b\u5c3e`## \u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/p>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\uff08Regular Expression\u3001\u7565\u3057\u3066Regex\uff09\u306f\u3001\u6587\u5b57\u5217\u304b\u3089\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u691c\u7d22\u30fb\u62bd\u51fa\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u95a2\u6570\u3067\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u53ef\u80fd\u306b\u3057\u3001\u30b3\u30fc\u30c9\u306e\u52b9\u7387\u5316\u3068\u67d4\u8edf\u6027\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002PHP\u306f\u8c4a\u5bcc\u306a\u6b63\u898f\u8868\u73fe\u95a2\u6570\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001\u3053\u308c\u3089\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u3053\u3068\u3067\u6587\u5b57\u5217\u51e6\u7406\u306e\u53ef\u80fd\u6027\u304c\u683c\u6bb5\u306b\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-22\">preg_match()\u3068preg_match_all()\u306b\u3088\u308b\u67d4\u8edf\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h3>\n\n\n\n<p>PHP\u3067\u6b63\u898f\u8868\u73fe\u3092\u6271\u3046\u4e3b\u8981\u306a\u95a2\u6570\u306f<code>preg_match()<\/code>\u3068<code>preg_match_all()<\/code>\u3067\u3059\u3002\u3053\u308c\u3089\u306fPCRE\uff08Perl Compatible Regular Expressions\uff09\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3001\u300c\/\u300d\uff08\u30c7\u30ea\u30df\u30bf\uff09\u3067\u56f2\u307e\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>preg_match()<\/strong>: \u30d1\u30bf\u30fc\u30f3\u304c\u6700\u521d\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int preg_match(string $pattern, string $subject, array &amp;$matches = null, int $flags = 0, int $offset = 0)\n<\/pre>\n\n\n\n<p><strong>preg_match_all()<\/strong>: \u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u90e8\u5206\u3092\u691c\u7d22\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int preg_match_all(string $pattern, string $subject, array &amp;$matches = null, int $flags = 0, int $offset = 0)\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ preg_match() - \u6700\u521d\u306b\u4e00\u81f4\u3059\u308b\u3082\u306e\u3060\u3051\u3092\u53d6\u5f97\n$text = \"\u304a\u554f\u3044\u5408\u308f\u305b\u306finfo@example.com\u307e\u305f\u306fsupport@example.jp\u307e\u3067\";\n$pattern = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n\nif (preg_match($pattern, $text, $matches)) {\n    echo \"\u6700\u521d\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9: \" . $matches[0]; \/\/ \"info@example.com\"\n}\n\n\/\/ preg_match_all() - \u3059\u3079\u3066\u306e\u4e00\u81f4\u3092\u53d6\u5f97\nif (preg_match_all($pattern, $text, $matches)) {\n    echo \"\u898b\u3064\u304b\u3063\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u6570: \" . count($matches[0]) . \"\\n\";\n    foreach ($matches[0] as $email) {\n        echo \"- \" . $email . \"\\n\";\n    }\n}\n\/\/ \u51fa\u529b:\n\/\/ \u898b\u3064\u304b\u3063\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u6570: 2\n\/\/ - info@example.com\n\/\/ - support@example.jp\n<\/pre>\n\n\n\n<p><strong>\u90e8\u5206\u30d1\u30bf\u30fc\u30f3\u306e\u62bd\u51fa\uff08\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\uff09<\/strong>:<\/p>\n\n\n\n<p>\u62ec\u5f27<code>()<\/code>\u3092\u4f7f\u3063\u3066\u30d1\u30bf\u30fc\u30f3\u306e\u4e00\u90e8\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3068\u3001\u305d\u306e\u90e8\u5206\u3060\u3051\u3092\u500b\u5225\u306b\u62bd\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$log = \"2023-10-15 14:30:25 [ERROR] Database connection failed: timeout\";\n$pattern = '\/(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2}:\\d{2}) \\[(\\w+)\\] (.*)\/';\n\nif (preg_match($pattern, $log, $matches)) {\n    \/\/ $matches[0]\u306b\u306f\u4e00\u81f4\u3057\u305f\u6587\u5b57\u5217\u5168\u4f53\u304c\u5165\u308b\n    echo \"\u65e5\u4ed8: \" . $matches[1] . \"\\n\";     \/\/ 2023-10-15\n    echo \"\u6642\u523b: \" . $matches[2] . \"\\n\";     \/\/ 14:30:25\n    echo \"\u30ec\u30d9\u30eb: \" . $matches[3] . \"\\n\";   \/\/ ERROR\n    echo \"\u30e1\u30c3\u30bb\u30fc\u30b8: \" . $matches[4] . \"\\n\"; \/\/ Database connection failed: timeout\n}\n<\/pre>\n\n\n\n<p><strong>\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/strong>:<\/p>\n\n\n\n<p>\u3088\u308a\u8aad\u307f\u3084\u3059\u304f\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306e\u305f\u3081\u306b\u3001\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u306b\u540d\u524d\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$url = \"https:\/\/www.example.com\/products\/category\/item?id=123&amp;color=blue\";\n$pattern = '\/^(?P&lt;protocol&gt;https?):\\\/\\\/(?P&lt;domain&gt;[\\w.-]+)(?P&lt;path&gt;\\\/[\\w\\\/.-]*)?(?:\\?(?P&lt;query&gt;[\\w=&amp;]+))?$\/';\n\nif (preg_match($pattern, $url, $matches)) {\n    echo \"\u30d7\u30ed\u30c8\u30b3\u30eb: \" . $matches['protocol'] . \"\\n\";  \/\/ https\n    echo \"\u30c9\u30e1\u30a4\u30f3: \" . $matches['domain'] . \"\\n\";      \/\/ www.example.com\n    echo \"\u30d1\u30b9: \" . $matches['path'] . \"\\n\";            \/\/ \/products\/category\/item\n    echo \"\u30af\u30a8\u30ea: \" . $matches['query'] . \"\\n\";         \/\/ id=123&amp;color=blue\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-23\">\u8907\u96d1\u306a\u6761\u4ef6\u3067\u306e\u6587\u5b57\u5217\u62bd\u51fa\u306b\u5f79\u7acb\u3064\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u5408\u81f4\u3059\u308b\u6587\u5b57\u5217\u3092\u62bd\u51fa\u3059\u308b\u30b7\u30ca\u30ea\u30aa\u304c\u983b\u7e41\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u3088\u304f\u4f7f\u308f\u308c\u308b\u5b9f\u7528\u7684\u306a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-24\">1. HTML\u304b\u3089\u306e\u7279\u5b9a\u8981\u7d20\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$html = '&lt;div class=\"content\"&gt;&lt;h1&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/h1&gt;&lt;p&gt;\u3053\u308c\u306f&lt;a href=\"https:\/\/example.com\"&gt;\u30ea\u30f3\u30af&lt;\/a&gt;\u3092\u542b\u3080\u6bb5\u843d\u3067\u3059\u3002&lt;\/p&gt;&lt;\/div&gt;';\n\n\/\/ h1\u30bf\u30b0\u306e\u5185\u5bb9\u3092\u62bd\u51fa\npreg_match('\/&lt;h1&gt;(.*?)&lt;\\\/h1&gt;\/', $html, $matches);\necho \"\u898b\u51fa\u3057: \" . $matches[1] . \"\\n\"; \/\/ \"\u30bf\u30a4\u30c8\u30eb\"\n\n\/\/ a\u30bf\u30b0\u306ehref\u5c5e\u6027\u5024\u3092\u62bd\u51fa\npreg_match('\/&lt;a\\s+[^&gt;]*href=[\"\\']([^\"\\']*)[\"\\'][^&gt;]*&gt;\/', $html, $matches);\necho \"\u30ea\u30f3\u30afURL: \" . $matches[1] . \"\\n\"; \/\/ \"https:\/\/example.com\"\n\n\/\/ \u3059\u3079\u3066\u306e\u30bf\u30b0\u3092\u9664\u53bb\u3057\u3066\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\n$plainText = preg_replace('\/&lt;[^&gt;]*&gt;\/', '', $html);\necho \"\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8: \" . $plainText . \"\\n\"; \/\/ \"\u30bf\u30a4\u30c8\u30eb\u3053\u308c\u306f\u30ea\u30f3\u30af\u3092\u542b\u3080\u6bb5\u843d\u3067\u3059\u3002\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-25\">2. \u6587\u7ae0\u304b\u3089\u306e\u7279\u5b9a\u60c5\u5831\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u65e5\u672c\u306e\u90f5\u4fbf\u756a\u53f7\uff083\u6841-4\u6841\u5f62\u5f0f\uff09\u3092\u62bd\u51fa\n$address = \"\u3012123-4567 \u6771\u4eac\u90fd\u65b0\u5bbf\u533a\u897f\u65b0\u5bbf1-2-3 \u30b5\u30f3\u30d7\u30eb\u30d3\u30eb101\";\npreg_match('\/\u3012?\\s*(\\d{3}[-]\\d{4})\/', $address, $matches);\necho \"\u90f5\u4fbf\u756a\u53f7: \" . $matches[1] . \"\\n\"; \/\/ \"123-4567\"\n\n\/\/ \u96fb\u8a71\u756a\u53f7\u3092\u62bd\u51fa\uff08\u69d8\u3005\u306a\u5f62\u5f0f\u306b\u5bfe\u5fdc\uff09\n$contact = \"\u304a\u96fb\u8a71: 03-1234-5678 \u307e\u305f\u306f 090-1234-5678\u3001+81-80-1234-5678\";\npreg_match_all('\/(?:\\+\\d{1,4}[-\\s]?)?\\d{2,4}[-\\s]?\\d{2,4}[-\\s]?\\d{4}\/', $contact, $matches);\nprint_r($matches[0]); \/\/ [\"03-1234-5678\", \"090-1234-5678\", \"+81-80-1234-5678\"]\n\n\/\/ \u65e5\u4ed8\u5f62\u5f0f\u3092\u62bd\u51fa\uff08YYYY\/MM\/DD \u307e\u305f\u306f YYYY-MM-DD\uff09\n$text = \"\u30a4\u30d9\u30f3\u30c8\u306f2023\/10\/15\u304b\u30892023-12-31\u307e\u3067\u958b\u50ac\u3055\u308c\u307e\u3059\u3002\";\npreg_match_all('\/\\d{4}[-\\\/]\\d{1,2}[-\\\/]\\d{1,2}\/', $text, $matches);\nprint_r($matches[0]); \/\/ [\"2023\/10\/15\", \"2023-12-31\"]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-26\">3. \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u95a2\u9023\u306e\u62bd\u51fa<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP\u306e\u5909\u6570\u540d\u3092\u62bd\u51fa\n$code = '$firstName = \"John\"; $lastName = \"Doe\"; echo $firstName . \" \" . $lastName;';\npreg_match_all('\/\\$([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)\/', $code, $matches);\nprint_r($matches[1]); \/\/ [\"firstName\", \"lastName\", \"firstName\", \"lastName\"]\n\n\/\/ \u30b3\u30e1\u30f3\u30c8\u3092\u62bd\u51fa\n$phpCode = '\n\/\/ \u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8\n$x = 1; \/* \u8907\u6570\u884c\n\u30b3\u30e1\u30f3\u30c8 *\/\n# \u5225\u306e\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8\n';\npreg_match_all('\/(\\\/\\\/.*?$|\\\/\\*.*?\\*\\\/|#.*?$)\/ms', $phpCode, $matches);\nprint_r($matches[0]); \/\/ [\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8, \u8907\u6570\u884c\u30b3\u30e1\u30f3\u30c8, \u5225\u306e\u5358\u4e00\u884c\u30b3\u30e1\u30f3\u30c8]\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-27\">\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u969b\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u4e0d\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u6b63\u898f\u8868\u73fe\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-28\">1. \u6700\u9069\u306a\u30d1\u30bf\u30fc\u30f3\u9078\u629e<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u975e\u52b9\u7387\u306a\u4f8b\uff08\u904e\u5270\u306a\u5f8c\u65b9\u53c2\u7167\uff09\n$pattern1 = '\/(.*)@(.*)\\.(.*)\/';\n\n\/\/ \u52b9\u7387\u7684\u306a\u4f8b\uff08\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u8868\u73fe\uff09\n$pattern2 = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-29\">2. \u8caa\u6b32\uff08Greedy\uff09vs \u975e\u8caa\u6b32\uff08Non-greedy\uff09\u91cf\u6307\u5b9a\u5b50<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$html = '&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c41&lt;\/div&gt;&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c42&lt;\/div&gt;';\n\n\/\/ \u8caa\u6b32\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09- \u6700\u3082\u9577\u3044\u30de\u30c3\u30c1\u3092\u8fd4\u3059\npreg_match('\/&lt;div&gt;(.*)&lt;\\\/div&gt;\/', $html, $matches1);\necho $matches1[1] . \"\\n\"; \/\/ \"\u30b3\u30f3\u30c6\u30f3\u30c41&lt;\/div&gt;&lt;div&gt;\u30b3\u30f3\u30c6\u30f3\u30c42\"\n\n\/\/ \u975e\u8caa\u6b32\uff08?\u3092\u8ffd\u52a0\uff09- \u6700\u3082\u77ed\u3044\u30de\u30c3\u30c1\u3092\u8fd4\u3059\npreg_match('\/&lt;div&gt;(.*?)&lt;\\\/div&gt;\/', $html, $matches2);\necho $matches2[1] . \"\\n\"; \/\/ \"\u30b3\u30f3\u30c6\u30f3\u30c41\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-30\">3. \u4e0d\u8981\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u3092\u907f\u3051\u308b<\/h4>\n\n\n\n<p>\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u4e0d\u8981\u306a\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u65e9\u671f\u306b\u9664\u5916\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$usernames = [\"user123\", \"admin_user\", \"not-valid\", \"another_user\"];\n\n\/\/ \u52b9\u7387\u7684: \u82f1\u6570\u5b57\u3068\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u306e\u307f\u3067\u69cb\u6210\u3055\u308c\u308b\u6587\u5b57\u5217\u306b\u30de\u30c3\u30c1\n$validPattern = '\/^[a-zA-Z0-9_]+$\/';\n\nforeach ($usernames as $username) {\n    if (preg_match($validPattern, $username)) {\n        echo \"{$username} \u306f\u6709\u52b9\u3067\u3059\\n\";\n    } else {\n        echo \"{$username} \u306f\u7121\u52b9\u3067\u3059\\n\";\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-31\">5. \u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u5206\u5272<\/h4>\n\n\n\n<p>\u975e\u5e38\u306b\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u8907\u6570\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u5206\u5272\u3059\u308b\u3053\u3068\u3067\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$text = \"\u9023\u7d61\u5148: 03-1234-5678\u3001\u30e1\u30fc\u30eb: info@example.com\";\n\n\/\/ \u8907\u96d1\u306a\u4e00\u3064\u306e\u30d1\u30bf\u30fc\u30f3\uff08\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u96e3\u3057\u3044\uff09\n$complexPattern = '\/(?:(?:\\+\\d{1,4}[-\\s]?)?\\d{2,4}[-\\s]?\\d{2,4}[-\\s]?\\d{4})|(?:[\\w.+-]+@[\\w-]+\\.[\\w.-]+)\/';\n\n\/\/ \u5206\u5272\u3057\u305f\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\uff08\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3057\u3084\u3059\u3044\uff09\n$phonePattern = '\/(?:\\+\\d{1,4}[-\\s]?)?\\d{2,4}[-\\s]?\\d{2,4}[-\\s]?\\d{4}\/';\n$emailPattern = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n\n\/\/ \u96fb\u8a71\u756a\u53f7\u306e\u62bd\u51fa\npreg_match($phonePattern, $text, $phoneMatches);\necho \"\u96fb\u8a71\u756a\u53f7: \" . $phoneMatches[0] . \"\\n\";\n\n\/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u62bd\u51fa\npreg_match($emailPattern, $text, $emailMatches);\necho \"\u30e1\u30fc\u30eb: \" . $emailMatches[0] . \"\\n\";\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-32\">6. \u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u306e\u518d\u5229\u7528<\/h4>\n\n\n\n<p>\u7e70\u308a\u8fd4\u3057\u4f7f\u7528\u3059\u308b\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u95a2\u6570\u5316\u3084\u30af\u30e9\u30b9\u5316\u3059\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u306e\u91cd\u8907\u3092\u6e1b\u3089\u3057\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class TextExtractor {\n    private $emailPattern = '\/[\\w.+-]+@[\\w-]+\\.[\\w.-]+\/';\n    private $phonePattern = '\/(?:\\+\\d{1,4}[-\\s]?)?\\d{2,4}[-\\s]?\\d{2,4}[-\\s]?\\d{4}\/';\n    private $datePattern = '\/\\d{4}[-\\\/]\\d{1,2}[-\\\/]\\d{1,2}\/';\n    \n    public function extractEmails($text) {\n        preg_match_all($this-&gt;emailPattern, $text, $matches);\n        return $matches[0];\n    }\n    \n    public function extractPhones($text) {\n        preg_match_all($this-&gt;phonePattern, $text, $matches);\n        return $matches[0];\n    }\n    \n    public function extractDates($text) {\n        preg_match_all($this-&gt;datePattern, $text, $matches);\n        return $matches[0];\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$extractor = new TextExtractor();\n$text = \"\u30a4\u30d9\u30f3\u30c8\u306f2023\/10\/15\u306b\u958b\u50ac\u3002\u9023\u7d61\u5148: info@example.com\u300103-1234-5678\";\n\n$emails = $extractor-&gt;extractEmails($text);\n$phones = $extractor-&gt;extractPhones($text);\n$dates = $extractor-&gt;extractDates($text);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-33\">7. \u6b63\u898f\u8868\u73fe\u306e\u30c7\u30d0\u30c3\u30b0<\/h4>\n\n\n\n<p>\u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u958b\u767a\u3059\u308b\u969b\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u91cd\u8981\u3067\u3059\u3002PHP\u3067\u306f<code>preg_last_error()<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001\u6b63\u898f\u8868\u73fe\u306e\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$pattern = '\/^(a+)+$\/';  \/\/ \u60aa\u540d\u9ad8\u3044\u300c\u30ab\u30bf\u30b9\u30c8\u30ed\u30d5\u30a3\u30c3\u30af\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u300d\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u306e\u3042\u308b\u30d1\u30bf\u30fc\u30f3\n$text = str_repeat('a', 100);\n\n$start = microtime(true);\n$result = preg_match($pattern, $text, $matches);\n$end = microtime(true);\n\nif ($result === false) {\n    echo \"\u30a8\u30e9\u30fc: \" . preg_last_error_msg() . \"\\n\";\n} else {\n    echo \"\u5b9f\u884c\u6642\u9593: \" . ($end - $start) . \"\u79d2\\n\";\n}\n<\/pre>\n\n\n\n<p>\u307e\u305f\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\uff08regex101.com\u306a\u3069\uff09\u3092\u6d3b\u7528\u3059\u308b\u3068\u3001\u30d1\u30bf\u30fc\u30f3\u306e\u53ef\u8996\u5316\u3084\u30c6\u30b9\u30c8\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-34\">\u6b63\u898f\u8868\u73fe\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u9650\u754c\u3092\u7406\u89e3\u3059\u308b<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u4e07\u80fd\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u7279\u306b\u3001HTML\u3084XML\u306a\u3069\u306e\u5165\u308c\u5b50\u69cb\u9020\u306e\u89e3\u6790\u306b\u306f\u9069\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u3001\u5c02\u7528\u306e\u30d1\u30fc\u30b5\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ HTML\u306e\u89e3\u6790\u306b\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\uff08\u975e\u63a8\u5968\uff09\n$html = '&lt;div&gt;&lt;p&gt;\u30c6\u30ad\u30b9\u30c8&lt;a href=\"link.html\"&gt;\u30ea\u30f3\u30af&lt;\/a&gt;&lt;\/p&gt;&lt;\/div&gt;';\npreg_match('\/&lt;div&gt;(.*?)&lt;\\\/div&gt;\/', $html, $matches);\n\n\/\/ DOMParser\u3092\u4f7f\u3046\uff08\u63a8\u5968\uff09\n$dom = new DOMDocument();\n$dom-&gt;loadHTML($html);\n$div = $dom-&gt;getElementsByTagName('div')-&gt;item(0);\n$content = $dom-&gt;saveHTML($div);\n<\/pre>\n\n\n\n<p>PHP\u306e\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3044\u3053\u306a\u3059\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u7c21\u6f54\u304b\u3064\u52b9\u7387\u7684\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u6587\u5b57\u5217\u304b\u3089\u306e\u30c7\u30fc\u30bf\u62bd\u51fa\u3084\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30ef\u30fc\u3092\u6700\u5927\u9650\u306b\u6d3b\u304b\u305b\u308b\u3067\u3057\u3087\u3046\u3002\u305f\u3060\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3092\u8003\u616e\u3057\u3066\u3001\u9069\u5207\u306a\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08\u3092\u5fc3\u304c\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-35\">\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56<\/h2>\n\n\n\n<p>PHP\u3067\u6587\u5b57\u5217\u3092\u6271\u3046\u969b\u306b\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u4e21\u9762\u306b\u6ce8\u610f\u3092\u6255\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3084\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u6271\u3046Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u5074\u9762\u304c\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u52b9\u7387\u7684\u304b\u3064\u5b89\u5168\u306a\u6587\u5b57\u5217\u51e6\u7406\u306e\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3084\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-36\">\u30e1\u30e2\u30ea\u52b9\u7387\u3092\u8003\u616e\u3057\u305f\u5927\u91cf\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306e\u65b9\u6cd5<\/h3>\n\n\n\n<p>PHP\u3067\u306f\u6587\u5b57\u5217\u64cd\u4f5c\u304c\u983b\u7e41\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u7279\u306b\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3068CPU\u8ca0\u8377\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u3092\u8003\u616e\u3057\u305f\u6587\u5b57\u5217\u51e6\u7406\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-37\">1. \u52b9\u7387\u7684\u306a\u6587\u5b57\u5217\u9023\u7d50<\/h4>\n\n\n\n<p>\u6587\u5b57\u5217\u3092\u9023\u7d50\u3059\u308b\u969b\u3001\u7570\u306a\u308b\u65b9\u6cd5\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u5927\u304d\u304f\u5909\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u975e\u52b9\u7387\u306a\u6587\u5b57\u5217\u9023\u7d50\uff08\u30eb\u30fc\u30d7\u3054\u3068\u306b\u65b0\u3057\u3044\u6587\u5b57\u5217\u304c\u751f\u6210\u3055\u308c\u308b\uff09\n$result = \"\";\nfor ($i = 0; $i &lt; 10000; $i++) {\n    $result = $result . \"\u8ffd\u52a0\u30c6\u30ad\u30b9\u30c8\"; \/\/ \u307e\u305f\u306f $result .= \"\u8ffd\u52a0\u30c6\u30ad\u30b9\u30c8\";\n}\n\n\/\/ \u52b9\u7387\u7684\u306a\u65b9\u6cd5: \u914d\u5217\u306b\u8ffd\u52a0\u3057\u3066\u304b\u3089\u4e00\u5ea6\u306bimplode\n$parts = [];\nfor ($i = 0; $i &lt; 10000; $i++) {\n    $parts[] = \"\u8ffd\u52a0\u30c6\u30ad\u30b9\u30c8\";\n}\n$result = implode(\"\", $parts);\n<\/pre>\n\n\n\n<p><strong>\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u7d50\u679c\u4f8b<\/strong>:<\/p>\n\n\n<div id=\"id-4d0c7c1c-0c86-48fa-9eb6-7a97248c6bd7\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u65b9\u6cd5<\/th><th>10,000\u56de\u306e\u9023\u7d50<\/th><th>100,000\u56de\u306e\u9023\u7d50<\/th><\/tr><\/thead><tbody><tr><td>.= \u6f14\u7b97\u5b50<\/td><td>0.05\u79d2<\/td><td>2.8\u79d2<\/td><\/tr><tr><td>\u914d\u5217 + implode<\/td><td>0.01\u79d2<\/td><td>0.3\u79d2<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-38\">2. \u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p>\u7279\u306b\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3001\u4e00\u5ea6\u306b\u3059\u3079\u3066\u3092\u30e1\u30e2\u30ea\u306b\u8aad\u307f\u8fbc\u3080\u306e\u3067\u306f\u306a\u304f\u3001\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u4f7f\u7528\u3059\u308b\u3068\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6291\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30e1\u30e2\u30ea\u52b9\u7387\u306e\u60aa\u3044\u65b9\u6cd5\uff08\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u3092\u30e1\u30e2\u30ea\u306b\u8aad\u307f\u8fbc\u3080\uff09\n$content = file_get_contents(\"large_file.txt\");\n$content = str_replace(\"old\", \"new\", $content);\nfile_put_contents(\"new_file.txt\", $content);\n\n\/\/ \u30e1\u30e2\u30ea\u52b9\u7387\u306e\u826f\u3044\u65b9\u6cd5\uff08\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u4f7f\u7528\uff09\n$input = fopen(\"large_file.txt\", \"r\");\n$output = fopen(\"new_file.txt\", \"w\");\n\nwhile (!feof($input)) {\n    $line = fgets($input);\n    $line = str_replace(\"old\", \"new\", $line);\n    fputs($output, $line);\n}\n\nfclose($input);\nfclose($output);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-39\">3. \u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u6d3b\u7528\u3057\u305f\u51e6\u7406<\/h4>\n\n\n\n<p>PHP 5.5\u4ee5\u964d\u3067\u306f\u3001\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ CSV\u30d5\u30a1\u30a4\u30eb\u306e\u5404\u884c\u3092\u9806\u6b21\u51e6\u7406\u3059\u308b\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\nfunction readCsvRows($filename) {\n    $handle = fopen($filename, \"r\");\n    while (($row = fgetcsv($handle)) !== false) {\n        yield $row;\n    }\n    fclose($handle);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nforeach (readCsvRows(\"large_data.csv\") as $row) {\n    \/\/ \u5404\u884c\u3092\u51e6\u7406\n    processRow($row);\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-40\">4. \u6b63\u898f\u8868\u73fe\u306e\u6700\u9069\u5316<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u975e\u52b9\u7387\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u975e\u52b9\u7387\u306a\u6b63\u898f\u8868\u73fe\uff08\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u304c\u591a\u767a\u3059\u308b\u53ef\u80fd\u6027\uff09\n$pattern1 = '\/a.*b.*c\/';\n\n\/\/ \u3088\u308a\u52b9\u7387\u7684\u306a\u6b63\u898f\u8868\u73fe\n$pattern2 = '\/a[^c]*b[^c]*c\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-41\">5. \u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570\u306e\u9078\u629e<\/h4>\n\n\n\n<p>\u540c\u3058\u7d50\u679c\u3092\u5f97\u3089\u308c\u308b\u8907\u6570\u306e\u95a2\u6570\u304c\u3042\u308b\u5834\u5408\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u9055\u3044\u3092\u8003\u616e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\u306e\u4f8b\n$text = str_repeat(\"abc123\", 100000);\n\n$start = microtime(true);\n$result1 = str_replace([\"a\", \"b\", \"c\"], [\"1\", \"2\", \"3\"], $text);\n$time1 = microtime(true) - $start;\n\n$start = microtime(true);\n$result2 = strtr($text, \"abc\", \"123\");\n$time2 = microtime(true) - $start;\n\necho \"str_replace: {$time1}\u79d2\\n\";\necho \"strtr: {$time2}\u79d2\\n\";\n<\/pre>\n\n\n\n<p>\u4e00\u822c\u7684\u306b<code>strtr()<\/code>\u306f\u8907\u6570\u306e\u6587\u5b57\u7f6e\u63db\u3067<code>str_replace()<\/code>\u3088\u308a\u9ad8\u901f\u3067\u3059\u304c\u3001\u72b6\u6cc1\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-42\">\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u304a\u3051\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u9632\u6b62\u7b56<\/h3>\n\n\n\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u4e0d\u9069\u5207\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8106\u5f31\u6027\u306b\u3064\u306a\u304c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4e3b\u8981\u306a\u30ea\u30b9\u30af\u3068\u305d\u306e\u5bfe\u7b56\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-43\">1. SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u5bfe\u7b56<\/h4>\n\n\n\n<p>SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306f\u3001\u60aa\u610f\u306e\u3042\u308bSQL\u30b3\u30fc\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30a8\u30ea\u306b\u633f\u5165\u3055\u308c\u308b\u653b\u6483\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8106\u5f31\u306a\u30b3\u30fc\u30c9\uff08\u5371\u967a\uff01\uff09\n$username = $_POST['username'];\n$query = \"SELECT * FROM users WHERE username = '$username'\";\n$result = $db-&gt;query($query);\n\n\/\/ \u5b89\u5168\u306a\u65b9\u6cd5: \u30d7\u30ea\u30da\u30a2\u30c9\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\n$stmt = $db-&gt;prepare(\"SELECT * FROM users WHERE username = ?\");\n$stmt-&gt;bind_param(\"s\", $_POST['username']);\n$stmt-&gt;execute();\n$result = $stmt-&gt;get_result();\n\n\/\/ PDO\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\n$stmt = $pdo-&gt;prepare(\"SELECT * FROM users WHERE username = :username\");\n$stmt-&gt;execute(['username' =&gt; $_POST['username']]);\n$result = $stmt-&gt;fetchAll();\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-44\">2. \u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\uff08XSS\uff09\u5bfe\u7b56<\/h4>\n\n\n\n<p>XSS\u653b\u6483\u3067\u306f\u3001\u60aa\u610f\u306e\u3042\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u304cWeb\u30da\u30fc\u30b8\u306b\u633f\u5165\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8106\u5f31\u306a\u30b3\u30fc\u30c9\uff08\u5371\u967a\uff01\uff09\necho \"\u3088\u3046\u3053\u305d, \" . $_GET['name'] . \"\u3055\u3093!\";\n\n\/\/ \u5b89\u5168\u306a\u65b9\u6cd5: HTML\u7279\u6b8a\u6587\u5b57\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\necho \"\u3088\u3046\u3053\u305d, \" . htmlspecialchars($_GET['name'], ENT_QUOTES, 'UTF-8') . \"\u3055\u3093!\";\n\n\/\/ \u95a2\u6570\u5316\u3057\u3066\u30b3\u30fc\u30c9\u5168\u4f53\u3067\u4e00\u8cab\u3057\u3066\u4f7f\u7528\nfunction h($str) {\n    return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}\n\necho \"\u3088\u3046\u3053\u305d, \" . h($_GET['name']) . \"\u3055\u3093!\";\n<\/pre>\n\n\n\n<p><strong>\u91cd\u8981\u306a\u70b9<\/strong>: \u51fa\u529b\u30a8\u30b9\u30b1\u30fc\u30d7\u306f\u6587\u8108\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ HTML\u5185\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\necho \"&lt;div&gt;\" . h($userContent) . \"&lt;\/div&gt;\";\n\n\/\/ JavaScript\u5185\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\necho \"&lt;script&gt;var username = '\" . json_encode($username) . \"';&lt;\/script&gt;\";\n\n\/\/ URL\u5c5e\u6027\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\necho \"&lt;a href='\" . h($url) . \"'&gt;\u30ea\u30f3\u30af&lt;\/a&gt;\";\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-45\">3. \u30d1\u30b9\u64cd\u4f5c\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c8\u30e9\u30d0\u30fc\u30b5\u30eb\u5bfe\u7b56<\/h4>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u6271\u3046\u969b\u306f\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c8\u30e9\u30d0\u30fc\u30b5\u30eb\u653b\u6483\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8106\u5f31\u306a\u30b3\u30fc\u30c9\uff08\u5371\u967a\uff01\uff09\n$file = $_GET['file'];\ninclude(\"files\/\" . $file);\n\n\/\/ \u5b89\u5168\u306a\u65b9\u6cd5: \u30d1\u30b9\u3092\u691c\u8a3c\n$file = $_GET['file'];\n$filepath = \"files\/\" . $file;\n\n\/\/ \u30d1\u30b9\u304c\u610f\u56f3\u3057\u305f\u7bc4\u56f2\u5185\u306b\u3042\u308b\u304b\u691c\u8a3c\n$realpath = realpath($filepath);\nif ($realpath === false || strpos($realpath, realpath(\"files\/\")) !== 0) {\n    die(\"\u7121\u52b9\u306a\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3067\u3059\");\n}\ninclude($realpath);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-46\">4. CSRF\u5bfe\u7b56<\/h4>\n\n\n\n<p>CSRF\u30c8\u30fc\u30af\u30f3\u306e\u751f\u6210\u3068\u691c\u8a3c\u306b\u306f\u5b89\u5168\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30c8\u30fc\u30af\u30f3\u751f\u6210\nfunction generateCsrfToken() {\n    if (empty($_SESSION['csrf_token'])) {\n        $_SESSION['csrf_token'] = bin2hex(random_bytes(32));\n    }\n    return $_SESSION['csrf_token'];\n}\n\n\/\/ \u30d5\u30a9\u30fc\u30e0\u3067\u306e\u4f7f\u7528\necho '&lt;form method=\"post\"&gt;';\necho '&lt;input type=\"hidden\" name=\"csrf_token\" value=\"' . h(generateCsrfToken()) . '\"&gt;';\necho '&lt;\/form&gt;';\n\n\/\/ \u30c8\u30fc\u30af\u30f3\u691c\u8a3c\nfunction verifyCsrfToken($token) {\n    return isset($_SESSION['csrf_token']) &amp;&amp; hash_equals($_SESSION['csrf_token'], $token);\n}\n\n\/\/ \u9001\u4fe1\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\nif (!verifyCsrfToken($_POST['csrf_token'])) {\n    die(\"\u7121\u52b9\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u3059\");\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-47\">5. \u5165\u529b\u691c\u8a3c\u3068\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/h4>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u51e6\u7406\u3059\u308b\u969b\u306f\u3001\u9069\u5207\u306a\u691c\u8a3c\u3068\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ filter_var()\u3092\u4f7f\u7528\u3057\u305f\u5165\u529b\u691c\u8a3c\n$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);\nif ($email === false) {\n    die(\"\u7121\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\");\n}\n\n\/\/ \u6574\u6570\u5024\u306e\u691c\u8a3c\n$id = filter_var($_GET['id'], FILTER_VALIDATE_INT);\nif ($id === false) {\n    die(\"\u7121\u52b9\u306aID\u3067\u3059\");\n}\n\n\/\/ URL\u306e\u691c\u8a3c\n$url = filter_var($_POST['website'], FILTER_VALIDATE_URL);\nif ($url === false) {\n    die(\"\u7121\u52b9\u306aURL\u3067\u3059\");\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-48\">PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u306e\u4e92\u63db\u6027\u3092\u7dad\u6301\u3059\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<p>PHP\u306f\u9032\u5316\u3057\u7d9a\u3051\u3066\u304a\u308a\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u6587\u5b57\u5217\u95a2\u6570\u306e\u52d5\u4f5c\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u4e92\u63db\u6027\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-49\">1. \u975e\u63a8\u5968\u95a2\u6570\u306e\u4ee3\u66ff<\/h4>\n\n\n\n<p>PHP\u306e\u9032\u5316\u3068\u3068\u3082\u306b\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u7406\u7531\u304b\u3089\u975e\u63a8\u5968\u3068\u306a\u3063\u305f\u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<div id=\"id-49aadf65-5276-4216-b465-ad547a73cb7c\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u975e\u63a8\u5968\u95a2\u6570<\/th><th>\u4ee3\u66ff\u95a2\u6570<\/th><th>\u5099\u8003<\/th><\/tr><\/thead><tbody><tr><td>mysql_escape_string()<\/td><td>mysqli_real_escape_string()\u307e\u305f\u306fPDO\u306e\u30d7\u30ea\u30da\u30a2\u30c9\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/td><td>PHP 7.0\u3067\u524a\u9664<\/td><\/tr><tr><td>ereg()<\/td><td>preg_match()<\/td><td>PHP 7.0\u3067\u524a\u9664<\/td><\/tr><tr><td>split()<\/td><td>explode()\u307e\u305f\u306fpreg_split()<\/td><td>PHP 7.0\u3067\u524a\u9664<\/td><\/tr><tr><td>mcrypt_*()<\/td><td>openssl_<em>()\u307e\u305f\u306fsodium_<\/em>()<\/td><td>PHP 7.2\u3067\u524a\u9664<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u53e4\u3044\u30b3\u30fc\u30c9\uff08PHP 7.0\u4ee5\u964d\u3067\u52d5\u4f5c\u3057\u306a\u3044\uff09\n$escaped = mysql_escape_string($input);\n\n\/\/ \u65b0\u3057\u3044\u30b3\u30fc\u30c9\n$escaped = mysqli_real_escape_string($connection, $input);\n\/\/ \u307e\u305f\u306f\uff08\u3088\u308a\u30d9\u30bf\u30fc\uff09\n$stmt = $mysqli-&gt;prepare(\"INSERT INTO table VALUES (?)\");\n$stmt-&gt;bind_param(\"s\", $input);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-50\">2. \u4e0b\u4f4d\u4e92\u63db\u6027\u306e\u3042\u308b\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u8907\u6570\u306ePHP\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u3001\u4e92\u63db\u6027\u30ec\u30a4\u30e4\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6587\u5b57\u5217\u95a2\u6570\u306e\u30e9\u30c3\u30d1\u30fc\u30af\u30e9\u30b9\u4f8b\nclass StringUtils {\n    \/**\n     * \u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e00\u8cab\u3057\u305f\u52d5\u4f5c\u3092\u3059\u308b\u6587\u5b57\u5217\u306e\u5148\u982d\u5207\u308a\u51fa\u3057\n     *\/\n    public static function startsWith($haystack, $needle) {\n        \/\/ PHP 8.0\u4ee5\u964d\u3067\u306f\u30cd\u30a4\u30c6\u30a3\u30d6\u95a2\u6570\u3092\u4f7f\u7528\n        if (function_exists('str_starts_with')) {\n            return str_starts_with($haystack, $needle);\n        }\n        \/\/ \u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u7528\u306e\u5b9f\u88c5\n        return $needle === '' || strpos($haystack, $needle) === 0;\n    }\n    \n    \/**\n     * \u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e00\u8cab\u3057\u305f\u52d5\u4f5c\u3092\u3059\u308b\u6587\u5b57\u5217\u306e\u672b\u5c3e\u30c1\u30a7\u30c3\u30af\n     *\/\n    public static function endsWith($haystack, $needle) {\n        if (function_exists('str_ends_with')) {\n            return str_ends_with($haystack, $needle);\n        }\n        return $needle === '' || substr($haystack, -strlen($needle)) === $needle;\n    }\n    \n    \/**\n     * \u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u4e00\u8cab\u3057\u305f\u52d5\u4f5c\u3092\u3059\u308b\u6587\u5b57\u5217\u691c\u7d22\n     *\/\n    public static function contains($haystack, $needle) {\n        if (function_exists('str_contains')) {\n            return str_contains($haystack, $needle);\n        }\n        return $needle === '' || strpos($haystack, $needle) !== false;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nif (StringUtils::startsWith($url, 'https:\/\/')) {\n    \/\/ \u5b89\u5168\u306aURL\u306e\u51e6\u7406\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-51\">3. PHP\u306e\u65b0\u6a5f\u80fd\u6d3b\u7528\u3068\u4e92\u63db\u6027\u306e\u4e21\u7acb<\/h4>\n\n\n\n<p>\u65b0\u3057\u3044PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u95a2\u3059\u308b\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 7.4: \u914d\u5217\u306e\u5206\u89e3\u3068\u7d50\u5408\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\n$parts = ['first', 'second', 'third'];\n\n\/\/ \u53e4\u3044\u65b9\u6cd5\n$first = $parts[0] ?? '';\n$second = $parts[1] ?? '';\n\n\/\/ PHP 7.4\u4ee5\u964d\n[$first, $second] = $parts + [1 =&gt; ''];\n\n\/\/ PHP 8.0: \u6587\u5b57\u5217\u306e\u4fbf\u5229\u306a\u95a2\u6570\n$url = \"https:\/\/example.com\/path\";\n\n\/\/ \u4e92\u63db\u6027\u3092\u6301\u305f\u305b\u305f\u66f8\u304d\u65b9\nif (function_exists('str_starts_with')) {\n    $isHttps = str_starts_with($url, 'https:\/\/');\n} else {\n    $isHttps = strpos($url, 'https:\/\/') === 0;\n}\n\n\/\/ PHP 8.0: Nullsafe\u6f14\u7b97\u5b50\n\/\/ \u53e4\u3044\u65b9\u6cd5\n$length = isset($text) ? strlen($text) : 0;\n\n\/\/ PHP 8.0\u4ee5\u964d\n$length = $text?-&gt;length;\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-52\">4. \u30d0\u30fc\u30b8\u30e7\u30f3\u3054\u3068\u306e\u9055\u3044\u3092\u8003\u616e\u3057\u305f\u578b\u5909\u63db<\/h4>\n\n\n\n<p>PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u6697\u9ed9\u306e\u578b\u5909\u63db\u306e\u6319\u52d5\u304c\u7570\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u3067\u4e00\u8cab\u6027\u3092\u4fdd\u3061\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6587\u5b57\u5217\u3068\u6570\u5024\u306e\u6bd4\u8f03\n$id = '123';\n\n\/\/ \u53b3\u5bc6\u306a\u6bd4\u8f03\u3092\u4f7f\u3046\uff08\u63a8\u5968\uff09\nif ($id === 123) { \/* \u4e00\u81f4\u3057\u306a\u3044 *\/ }\nif ((int)$id === 123) { \/* \u4e00\u81f4\u3059\u308b *\/ }\n\n\/\/ \u6587\u5b57\u5217\u64cd\u4f5c\u306e\u969b\u306e\u578b\u306e\u660e\u793a\n$length = (int)$_GET['length'] ?? 0;\nif ($length &gt; 0) {\n    $substring = substr($string, 0, $length);\n}\n<\/pre>\n\n\n\n<p>\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u6ce8\u610f\u3092\u6255\u3046\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306aPHP\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u6271\u3046Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u5e38\u306b\u610f\u8b58\u3057\u3001\u9069\u5207\u306a\u5bfe\u7b56\u3092\u65bd\u3059\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u307e\u305f\u3001\u8907\u6570\u306ePHP\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u306e\u9055\u3044\u3092\u7406\u89e3\u3057\u3001\u4e92\u63db\u6027\u306e\u3042\u308b\u30b3\u30fc\u30c9\u3092\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-53\">\u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306e\u5b9f\u8df5\u4f8b<\/h2>\n\n\n\n<p>\u3053\u308c\u307e\u3067\u89e3\u8aac\u3057\u3066\u304d\u305f\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u77e5\u8b58\u3092\u5b9f\u52d9\u3067\u3069\u306e\u3088\u3046\u306b\u6d3b\u7528\u3067\u304d\u308b\u304b\u3001\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u4f8b\u3092\u901a\u3058\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3088\u304f\u906d\u9047\u3059\u308b3\u3064\u306e\u30b7\u30ca\u30ea\u30aa\u306b\u7126\u70b9\u3092\u5f53\u3066\u3001\u52b9\u7387\u7684\u304b\u3064\u5805\u7262\u306a\u30b3\u30fc\u30c9\u5b9f\u88c5\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-54\">CSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u5b9f\u88c5\u4f8b<\/h3>\n\n\n\n<p>CSV\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30c7\u30fc\u30bf\u4ea4\u63db\u3084\u30a4\u30f3\u30dd\u30fc\u30c8\u30fb\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u51e6\u7406\u3067\u3088\u304f\u4f7f\u7528\u3055\u308c\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002PHP\u3067CSV\u30c7\u30fc\u30bf\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-55\">1. \u57fa\u672c\u7684\u306aCSV\u8aad\u307f\u8fbc\u307f\u3068\u7279\u5b9a\u30c7\u30fc\u30bf\u306e\u62bd\u51fa<\/h4>\n\n\n\n<p>\u307e\u305a\u3001\u30b7\u30f3\u30d7\u30eb\u306aCSV\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u3068\u7279\u5b9a\u6761\u4ef6\u306b\u57fa\u3065\u304f\u30c7\u30fc\u30bf\u62bd\u51fa\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * CSV\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u7279\u5b9a\u6761\u4ef6\u306e\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\n * @param string $filename CSV\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\n * @param array $conditions \u62bd\u51fa\u6761\u4ef6 [\u30ab\u30e9\u30e0\u540d =&gt; \u5024]\n * @return array \u62bd\u51fa\u3055\u308c\u305f\u30c7\u30fc\u30bf\n *\/\nfunction extractDataFromCsv($filename, $conditions = []) {\n    if (!file_exists($filename)) {\n        throw new Exception(\"\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093: $filename\");\n    }\n    \n    $handle = fopen($filename, 'r');\n    if ($handle === false) {\n        throw new Exception(\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u307e\u305b\u3093: $filename\");\n    }\n    \n    \/\/ \u30d8\u30c3\u30c0\u30fc\u884c\u3092\u8aad\u307f\u8fbc\u307f\n    $headers = fgetcsv($handle);\n    if ($headers === false) {\n        fclose($handle);\n        throw new Exception(\"CSV\u30d8\u30c3\u30c0\u30fc\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\");\n    }\n    \n    $result = [];\n    \n    \/\/ \u5404\u884c\u3092\u51e6\u7406\n    while (($row = fgetcsv($handle)) !== false) {\n        \/\/ \u30ab\u30e9\u30e0\u540d\u3092\u30ad\u30fc\u3068\u3059\u308b\u9023\u60f3\u914d\u5217\u306b\u5909\u63db\n        $data = array_combine($headers, $row);\n        \n        \/\/ \u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u304b\u78ba\u8a8d\n        $match = true;\n        foreach ($conditions as $column =&gt; $value) {\n            if (!isset($data[$column]) || $data[$column] != $value) {\n                $match = false;\n                break;\n            }\n        }\n        \n        if ($match) {\n            $result[] = $data;\n        }\n    }\n    \n    fclose($handle);\n    return $result;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\uff1a\u90fd\u9053\u5e9c\u770c\u304c\u300c\u6771\u4eac\u300d\u306e\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\ntry {\n    $tokyoCustomers = extractDataFromCsv('customers.csv', ['prefecture' =&gt; '\u6771\u4eac\u90fd']);\n    echo \"\u6771\u4eac\u90fd\u306e\u9867\u5ba2\u6570: \" . count($tokyoCustomers) . \"\u4eba\\n\";\n    \n    \/\/ \u62bd\u51fa\u30c7\u30fc\u30bf\u306e\u5229\u7528\u4f8b\n    foreach ($tokyoCustomers as $customer) {\n        echo $customer['name'] . \"\u69d8 (\" . $customer['email'] . \")\\n\";\n    }\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-56\">2. \u5927\u304d\u306aCSV\u30d5\u30a1\u30a4\u30eb\u306e\u52b9\u7387\u7684\u306a\u51e6\u7406<\/h4>\n\n\n\n<p>\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3080CSV\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u3092\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u305f\u52b9\u7387\u7684\u306a\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u5927\u304d\u306aCSV\u30d5\u30a1\u30a4\u30eb\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3059\u308b\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\n * @param string $filename CSV\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\n * @param callable|null $filter \u30d5\u30a3\u30eb\u30bf\u95a2\u6570\uff08\u5404\u884c\u306b\u9069\u7528\uff09\n * @param callable|null $transform \u5909\u63db\u95a2\u6570\uff08\u30d5\u30a3\u30eb\u30bf\u3092\u901a\u904e\u3057\u305f\u884c\u306b\u9069\u7528\uff09\n * @yield array \u51e6\u7406\u3055\u308c\u305f\u5404\u884c\n *\/\nfunction processCsvFile($filename, $filter = null, $transform = null) {\n    $handle = fopen($filename, 'r');\n    if ($handle === false) {\n        throw new Exception(\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u307e\u305b\u3093: $filename\");\n    }\n    \n    \/\/ \u30d8\u30c3\u30c0\u30fc\u884c\u3092\u8aad\u307f\u8fbc\u307f\n    $headers = fgetcsv($handle);\n    if ($headers === false) {\n        fclose($handle);\n        throw new Exception(\"CSV\u30d8\u30c3\u30c0\u30fc\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\");\n    }\n    \n    \/\/ \u5404\u884c\u3092\u51e6\u7406\n    while (($row = fgetcsv($handle)) !== false) {\n        \/\/ \u30ab\u30e9\u30e0\u540d\u3092\u30ad\u30fc\u3068\u3059\u308b\u9023\u60f3\u914d\u5217\u306b\u5909\u63db\n        $data = array_combine($headers, $row);\n        \n        \/\/ \u30d5\u30a3\u30eb\u30bf\u95a2\u6570\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u9069\u7528\u3059\u308b\n        if ($filter !== null &amp;&amp; !$filter($data)) {\n            continue;\n        }\n        \n        \/\/ \u5909\u63db\u95a2\u6570\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u9069\u7528\u3059\u308b\n        if ($transform !== null) {\n            $data = $transform($data);\n        }\n        \n        yield $data;\n    }\n    \n    fclose($handle);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\uff1a\u58f2\u4e0a\u30c7\u30fc\u30bf\u306e\u96c6\u8a08\ntry {\n    \/\/ \u30d5\u30a3\u30eb\u30bf\u95a2\u6570\uff1a2023\u5e74\u306e\u30c7\u30fc\u30bf\u306e\u307f\n    $yearFilter = function($row) {\n        return substr($row['date'], 0, 4) === '2023';\n    };\n    \n    \/\/ \u5909\u63db\u95a2\u6570\uff1a\u91d1\u984d\u3092\u6570\u5024\u306b\u5909\u63db\n    $amountTransform = function($row) {\n        $row['amount'] = (float)str_replace(',', '', $row['amount']);\n        return $row;\n    };\n    \n    $totalAmount = 0;\n    $count = 0;\n    \n    \/\/ CSV\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\n    foreach (processCsvFile('sales.csv', $yearFilter, $amountTransform) as $sale) {\n        $totalAmount += $sale['amount'];\n        $count++;\n        \n        \/\/ \u30e1\u30e2\u30ea\u4f7f\u7528\u72b6\u6cc1\u3092\u78ba\u8a8d\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09\n        if ($count % 10000 === 0) {\n            echo \"\u51e6\u7406\u4ef6\u6570: $count, \u30e1\u30e2\u30ea\u4f7f\u7528\u91cf: \" . memory_get_usage(true) \/ 1024 \/ 1024 . \"MB\\n\";\n        }\n    }\n    \n    echo \"2023\u5e74\u306e\u7dcf\u58f2\u4e0a: \" . number_format($totalAmount) . \"\u5186 (\u5408\u8a08 $count \u4ef6)\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-57\">3. \u30ab\u30e9\u30e0\u5225\u306e\u9ad8\u5ea6\u306a\u30c7\u30fc\u30bf\u51e6\u7406<\/h4>\n\n\n\n<p>\u7279\u5b9a\u306e\u30ab\u30e9\u30e0\u306b\u5bfe\u3057\u3066\u8907\u96d1\u306a\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * CSV\u306e\u7279\u5b9a\u30ab\u30e9\u30e0\u306b\u5bfe\u3057\u3066\u8907\u96d1\u306a\u51e6\u7406\u3092\u884c\u3046\n * @param string $filename CSV\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\n * @param string $targetColumn \u51e6\u7406\u5bfe\u8c61\u306e\u30ab\u30e9\u30e0\u540d\n * @param callable $columnProcessor \u30ab\u30e9\u30e0\u51e6\u7406\u95a2\u6570\n * @return array \u51e6\u7406\u7d50\u679c\n *\/\nfunction processSpecificColumn($filename, $targetColumn, $columnProcessor) {\n    $data = [];\n    $handle = fopen($filename, 'r');\n    \n    if ($handle === false) {\n        throw new Exception(\"\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u307e\u305b\u3093: $filename\");\n    }\n    \n    \/\/ \u30d8\u30c3\u30c0\u30fc\u884c\u3092\u8aad\u307f\u8fbc\u307f\n    $headers = fgetcsv($handle);\n    if ($headers === false) {\n        fclose($handle);\n        throw new Exception(\"CSV\u30d8\u30c3\u30c0\u30fc\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\");\n    }\n    \n    \/\/ \u5bfe\u8c61\u30ab\u30e9\u30e0\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\n    $columnIndex = array_search($targetColumn, $headers);\n    if ($columnIndex === false) {\n        fclose($handle);\n        throw new Exception(\"\u6307\u5b9a\u3055\u308c\u305f\u30ab\u30e9\u30e0\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: $targetColumn\");\n    }\n    \n    \/\/ \u5404\u884c\u3092\u51e6\u7406\n    while (($row = fgetcsv($handle)) !== false) {\n        \/\/ \u5bfe\u8c61\u30ab\u30e9\u30e0\u306e\u5024\u3092\u51e6\u7406\u95a2\u6570\u3067\u52a0\u5de5\n        $row[$columnIndex] = $columnProcessor($row[$columnIndex]);\n        $data[] = array_combine($headers, $row);\n    }\n    \n    fclose($handle);\n    return $data;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\uff1a\u4f4f\u6240\u304b\u3089\u90f5\u4fbf\u756a\u53f7\u3092\u62bd\u51fa\ntry {\n    \/\/ \u4f4f\u6240\u304b\u3089\u90f5\u4fbf\u756a\u53f7\u3092\u62bd\u51fa\u3059\u308b\u51e6\u7406\u95a2\u6570\n    $extractPostalCode = function($address) {\n        if (preg_match('\/\u3012?\\s*(\\d{3}-\\d{4})\/', $address, $matches)) {\n            return $matches[1];\n        }\n        return '\u4e0d\u660e';\n    };\n    \n    $processedData = processSpecificColumn('addresses.csv', 'address', $extractPostalCode);\n    \n    \/\/ CSV\u306b\u66f8\u304d\u51fa\u3057\n    $output = fopen('addresses_with_postal.csv', 'w');\n    fputcsv($output, array_keys($processedData[0]));\n    \n    foreach ($processedData as $row) {\n        fputcsv($output, $row);\n    }\n    \n    fclose($output);\n    echo \"\u51e6\u7406\u5b8c\u4e86: \" . count($processedData) . \"\u4ef6\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3057\u307e\u3057\u305f\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-58\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u691c\u8a3c\u3068\u6574\u5f62\u306b\u4f7f\u3048\u308b\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u53d7\u3051\u53d6\u308b\u5165\u529b\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3068\u6574\u5f62\u304c\u91cd\u8981\u3067\u3059\u3002\u9069\u5207\u306a\u6587\u5b57\u5217\u51e6\u7406\u30c6\u30af\u30cb\u30c3\u30af\u3092\u4f7f\u3063\u3066\u3001\u5b89\u5168\u304b\u3064\u4f7f\u3044\u3084\u3059\u3044\u30d5\u30a9\u30fc\u30e0\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-59\">1. \u5165\u529b\u691c\u8a3c\u3068\u578b\u5909\u63db\u306e\u30d8\u30eb\u30d1\u30fc\u30af\u30e9\u30b9<\/h4>\n\n\n\n<p>\u3055\u307e\u3056\u307e\u306a\u30bf\u30a4\u30d7\u306e\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u691c\u8a3c\u30fb\u6574\u5f62\u3059\u308b\u305f\u3081\u306e\u30d8\u30eb\u30d1\u30fc\u30af\u30e9\u30b9\u306e\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u691c\u8a3c\u3068\u6574\u5f62\u3092\u884c\u3046\u30d8\u30eb\u30d1\u30fc\u30af\u30e9\u30b9\n *\/\nclass InputValidator {\n    \/**\n     * \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u691c\u8a3c\n     * @param string $email \u691c\u8a3c\u3059\u308b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n     * @return string|false \u6709\u52b9\u306a\u5834\u5408\u306f\u6574\u5f62\u6e08\u307f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u7121\u52b9\u306a\u5834\u5408\u306ffalse\n     *\/\n    public static function validateEmail($email) {\n        $email = filter_var(trim($email), FILTER_VALIDATE_EMAIL);\n        if ($email === false) {\n            return false;\n        }\n        return mb_strtolower($email);\n    }\n    \n    \/**\n     * \u96fb\u8a71\u756a\u53f7\u3092\u691c\u8a3c\u3057\u6a19\u6e96\u5f62\u5f0f\u306b\u6574\u5f62\n     * @param string $phone \u691c\u8a3c\u3059\u308b\u96fb\u8a71\u756a\u53f7\n     * @return string|false \u6709\u52b9\u306a\u5834\u5408\u306f\u6574\u5f62\u6e08\u307f\u96fb\u8a71\u756a\u53f7\u3001\u7121\u52b9\u306a\u5834\u5408\u306ffalse\n     *\/\n    public static function validatePhone($phone) {\n        \/\/ \u534a\u89d2\u6570\u5b57\u4ee5\u5916\u3092\u9664\u53bb\n        $phone = preg_replace('\/[^\\d]\/', '', $phone);\n        \n        \/\/ \u6841\u6570\u30c1\u30a7\u30c3\u30af\uff0810\u6841\u307e\u305f\u306f11\u6841\uff09\n        if (strlen($phone) !== 10 &amp;&amp; strlen($phone) !== 11) {\n            return false;\n        }\n        \n        \/\/ \u5148\u982d\u304c0\u304b\u3089\u59cb\u307e\u308b\u304b\u78ba\u8a8d\n        if (substr($phone, 0, 1) !== '0') {\n            return false;\n        }\n        \n        \/\/ \u5f62\u5f0f\u6574\u5f62\uff08\u4f8b: 090-1234-5678\uff09\n        if (strlen($phone) === 11) {\n            return substr($phone, 0, 3) . '-' . substr($phone, 3, 4) . '-' . substr($phone, 7, 4);\n        } else {\n            return substr($phone, 0, 3) . '-' . substr($phone, 3, 3) . '-' . substr($phone, 6, 4);\n        }\n    }\n    \n    \/**\n     * \u65e5\u4ed8\u3092\u691c\u8a3c\u3057Y-m-d\u5f62\u5f0f\u306b\u6574\u5f62\n     * @param string $date \u691c\u8a3c\u3059\u308b\u65e5\u4ed8\uff08\u69d8\u3005\u306a\u5f62\u5f0f\u5bfe\u5fdc\uff09\n     * @return string|false \u6709\u52b9\u306a\u5834\u5408\u306fY-m-d\u5f62\u5f0f\u306e\u65e5\u4ed8\u3001\u7121\u52b9\u306a\u5834\u5408\u306ffalse\n     *\/\n    public static function validateDate($date) {\n        \/\/ \u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u30cf\u30a4\u30d5\u30f3\u306b\u7d71\u4e00\n        $date = str_replace('\/', '-', trim($date));\n        \n        \/\/ \u548c\u66a6\u5bfe\u5fdc\uff08\u4f8b: R3-10-15 \u2192 2021-10-15\uff09\n        if (preg_match('\/^([MTSHR])(\\d+)-(\\d+)-(\\d+)$\/', $date, $matches)) {\n            $eraMap = [\n                'M' =&gt; 1868, \/\/ \u660e\u6cbb\n                'T' =&gt; 1912, \/\/ \u5927\u6b63\n                'S' =&gt; 1926, \/\/ \u662d\u548c\n                'H' =&gt; 1989, \/\/ \u5e73\u6210\n                'R' =&gt; 2019  \/\/ \u4ee4\u548c\n            ];\n            \n            $year = $eraMap[$matches[1]] + (int)$matches[2] - 1;\n            $date = $year . '-' . $matches[3] . '-' . $matches[4];\n        }\n        \n        \/\/ \u65e5\u4ed8\u3068\u3057\u3066\u306e\u59a5\u5f53\u6027\u30c1\u30a7\u30c3\u30af\n        $timestamp = strtotime($date);\n        if ($timestamp === false) {\n            return false;\n        }\n        \n        return date('Y-m-d', $timestamp);\n    }\n    \n    \/**\n     * \u90f5\u4fbf\u756a\u53f7\u3092\u691c\u8a3c\u3057\u6a19\u6e96\u5f62\u5f0f\u306b\u6574\u5f62\n     * @param string $postalCode \u691c\u8a3c\u3059\u308b\u90f5\u4fbf\u756a\u53f7\n     * @return string|false \u6709\u52b9\u306a\u5834\u5408\u306f\u6574\u5f62\u6e08\u307f\u90f5\u4fbf\u756a\u53f7\u3001\u7121\u52b9\u306a\u5834\u5408\u306ffalse\n     *\/\n    public static function validatePostalCode($postalCode) {\n        \/\/ \u4e0d\u8981\u306a\u6587\u5b57\u3092\u9664\u53bb\n        $postalCode = preg_replace('\/[^\\d]\/', '', $postalCode);\n        \n        \/\/ 7\u6841\u30c1\u30a7\u30c3\u30af\n        if (strlen($postalCode) !== 7) {\n            return false;\n        }\n        \n        \/\/ \u5f62\u5f0f\u6574\u5f62\uff08\u4f8b: 123-4567\uff09\n        return substr($postalCode, 0, 3) . '-' . substr($postalCode, 3, 4);\n    }\n    \n    \/**\n     * \u5168\u89d2\u30fb\u534a\u89d2\u5909\u63db\u3092\u884c\u3046\n     * @param string $str \u5909\u63db\u3059\u308b\u6587\u5b57\u5217\n     * @param int $mode \u5909\u63db\u30e2\u30fc\u30c9\uff081:\u5168\u89d2\u2192\u534a\u89d2\u30012:\u534a\u89d2\u2192\u5168\u89d2\u30013:\u30ab\u30bf\u30ab\u30ca\u2192\u3072\u3089\u304c\u306a\u30014:\u3072\u3089\u304c\u306a\u2192\u30ab\u30bf\u30ab\u30ca\uff09\n     * @return string \u5909\u63db\u5f8c\u306e\u6587\u5b57\u5217\n     *\/\n    public static function convertCharacterWidth($str, $mode) {\n        switch ($mode) {\n            case 1: \/\/ \u5168\u89d2\u2192\u534a\u89d2\n                return mb_convert_kana($str, 'rnaskhc');\n            case 2: \/\/ \u534a\u89d2\u2192\u5168\u89d2\n                return mb_convert_kana($str, 'RNASKHC');\n            case 3: \/\/ \u30ab\u30bf\u30ab\u30ca\u2192\u3072\u3089\u304c\u306a\n                return mb_convert_kana($str, 'c');\n            case 4: \/\/ \u3072\u3089\u304c\u306a\u2192\u30ab\u30bf\u30ab\u30ca\n                return mb_convert_kana($str, 'C');\n            default:\n                return $str;\n        }\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u305f\u9577\u3055\u3067\u5207\u308a\u8a70\u3081\u3001\u672b\u5c3e\u306b\u7701\u7565\u8a18\u53f7\u3092\u4ed8\u52a0\n     * @param string $str \u5207\u308a\u8a70\u3081\u308b\u6587\u5b57\u5217\n     * @param int $length \u6700\u5927\u9577\uff08\u6587\u5b57\u6570\uff09\n     * @param string $suffix \u7701\u7565\u8a18\u53f7\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: ...\uff09\n     * @return string \u5207\u308a\u8a70\u3081\u305f\u6587\u5b57\u5217\n     *\/\n    public static function truncate($str, $length, $suffix = '...') {\n        if (mb_strlen($str) &lt;= $length) {\n            return $str;\n        }\n        \n        return mb_substr($str, 0, $length) . $suffix;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$email = InputValidator::validateEmail(' Example@EXAMPLE.com ');\necho $email ? \"\u6709\u52b9\u306a\u30e1\u30fc\u30eb: $email\" : \"\u7121\u52b9\u306a\u30e1\u30fc\u30eb\";\n\/\/ \u51fa\u529b: \u6709\u52b9\u306a\u30e1\u30fc\u30eb: example@example.com\n\n$phone = InputValidator::validatePhone('090-1234-5678');\necho $phone ? \"\u6709\u52b9\u306a\u96fb\u8a71: $phone\" : \"\u7121\u52b9\u306a\u96fb\u8a71\";\n\/\/ \u51fa\u529b: \u6709\u52b9\u306a\u96fb\u8a71: 090-1234-5678\n\n$date = InputValidator::validateDate('R3\/10\/15');\necho $date ? \"\u6709\u52b9\u306a\u65e5\u4ed8: $date\" : \"\u7121\u52b9\u306a\u65e5\u4ed8\";\n\/\/ \u51fa\u529b: \u6709\u52b9\u306a\u65e5\u4ed8: 2021-10-15\n\n$text = InputValidator::truncate('\u3053\u308c\u306f\u9577\u3044\u6587\u7ae0\u3067\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5207\u308a\u8a70\u3081\u307e\u3059\u3002', 10);\necho $text; \/\/ \u51fa\u529b: \u3053\u308c\u306f\u9577\u3044\u6587\u7ae0\u3067...\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-60\">2. \u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u30c7\u30fc\u30bf\u306e\u4e00\u62ec\u691c\u8a3c<\/h4>\n\n\n\n<p>\u8907\u6570\u306e\u5165\u529b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3064\u30d5\u30a9\u30fc\u30e0\u3092\u4e00\u62ec\u3067\u691c\u8a3c\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u3059\u308b\n * @param array $formData \u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u306e\u9023\u60f3\u914d\u5217\n * @param array $rules \u30d5\u30a3\u30fc\u30eb\u30c9\u3054\u3068\u306e\u691c\u8a3c\u30eb\u30fc\u30eb\n * @return array [\u6210\u529f\u30d5\u30e9\u30b0, \u691c\u8a3c\u6e08\u307f\u30c7\u30fc\u30bf, \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8]\n *\/\nfunction validateForm($formData, $rules) {\n    $validatedData = [];\n    $errors = [];\n    \n    foreach ($rules as $field =&gt; $rule) {\n        \/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\n        if (!isset($formData[$field])) {\n            if (!empty($rule['required'])) {\n                $errors[$field] = ($rule['errorMessage'] ?? '') ?: \"{$field}\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059\";\n            }\n            continue;\n        }\n        \n        $value = trim($formData[$field]);\n        \n        \/\/ \u5fc5\u9808\u30c1\u30a7\u30c3\u30af\n        if (empty($value) &amp;&amp; !empty($rule['required'])) {\n            $errors[$field] = ($rule['errorMessage'] ?? '') ?: \"{$field}\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059\";\n            continue;\n        }\n        \n        \/\/ \u6700\u5c0f\u9577\u30c1\u30a7\u30c3\u30af\n        if (isset($rule['minLength']) &amp;&amp; mb_strlen($value) &lt; $rule['minLength']) {\n            $errors[$field] = \"{$field}\u306f{$rule['minLength']}\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\";\n            continue;\n        }\n        \n        \/\/ \u6700\u5927\u9577\u30c1\u30a7\u30c3\u30af\n        if (isset($rule['maxLength']) &amp;&amp; mb_strlen($value) &gt; $rule['maxLength']) {\n            $errors[$field] = \"{$field}\u306f{$rule['maxLength']}\u6587\u5b57\u4ee5\u4e0b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\";\n            continue;\n        }\n        \n        \/\/ \u578b\u30c1\u30a7\u30c3\u30af\u3068\u5909\u63db\n        switch ($rule['type'] ?? '') {\n            case 'email':\n                $email = InputValidator::validateEmail($value);\n                if ($email === false) {\n                    $errors[$field] = \"\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\";\n                } else {\n                    $validatedData[$field] = $email;\n                }\n                break;\n                \n            case 'phone':\n                $phone = InputValidator::validatePhone($value);\n                if ($phone === false) {\n                    $errors[$field] = \"\u6709\u52b9\u306a\u96fb\u8a71\u756a\u53f7\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\";\n                } else {\n                    $validatedData[$field] = $phone;\n                }\n                break;\n                \n            case 'date':\n                $date = InputValidator::validateDate($value);\n                if ($date === false) {\n                    $errors[$field] = \"\u6709\u52b9\u306a\u65e5\u4ed8\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\";\n                } else {\n                    $validatedData[$field] = $date;\n                }\n                break;\n                \n            case 'integer':\n                if (!ctype_digit($value) &amp;&amp; !is_int($value)) {\n                    $errors[$field] = \"\u6574\u6570\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\";\n                } else {\n                    $validatedData[$field] = (int)$value;\n                }\n                break;\n                \n            case 'float':\n                $value = str_replace(',', '', $value);\n                if (!is_numeric($value)) {\n                    $errors[$field] = \"\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\";\n                } else {\n                    $validatedData[$field] = (float)$value;\n                }\n                break;\n                \n            case 'text':\n            default:\n                $validatedData[$field] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n                break;\n        }\n        \n        \/\/ \u30ab\u30b9\u30bf\u30e0\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u95a2\u6570\n        if (isset($rule['validate']) &amp;&amp; is_callable($rule['validate'])) {\n            $customResult = $rule['validate']($value);\n            if ($customResult !== true) {\n                $errors[$field] = is_string($customResult) ? $customResult : \"{$field}\u306e\u5165\u529b\u304c\u7121\u52b9\u3067\u3059\";\n            }\n        }\n    }\n    \n    return [\n        'success' =&gt; empty($errors),\n        'data' =&gt; $validatedData,\n        'errors' =&gt; $errors\n    ];\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$formData = [\n    'name' =&gt; ' \u5c71\u7530 \u592a\u90ce ',\n    'email' =&gt; 'yamada@example.com',\n    'age' =&gt; '30',\n    'phone' =&gt; '090-1234-5678',\n    'message' =&gt; '&lt;script&gt;alert(\"XSS\");&lt;\/script&gt;'\n];\n\n$rules = [\n    'name' =&gt; [\n        'required' =&gt; true,\n        'maxLength' =&gt; 50,\n        'type' =&gt; 'text'\n    ],\n    'email' =&gt; [\n        'required' =&gt; true,\n        'type' =&gt; 'email'\n    ],\n    'age' =&gt; [\n        'required' =&gt; true,\n        'type' =&gt; 'integer',\n        'validate' =&gt; function($value) {\n            if ($value &lt; 18) {\n                return '18\u6b73\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n            }\n            return true;\n        }\n    ],\n    'phone' =&gt; [\n        'type' =&gt; 'phone'\n    ],\n    'message' =&gt; [\n        'maxLength' =&gt; 1000,\n        'type' =&gt; 'text'\n    ]\n];\n\n$result = validateForm($formData, $rules);\n\nif ($result['success']) {\n    echo \"\u691c\u8a3c\u6210\u529f\uff01\\n\";\n    print_r($result['data']);\n} else {\n    echo \"\u691c\u8a3c\u5931\u6557:\\n\";\n    print_r($result['errors']);\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-61\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u3084JSON\u304b\u3089\u306e\u5fc5\u8981\u60c5\u5831\u62bd\u51fa\u65b9\u6cd5<\/h3>\n\n\n\n<p>Web API\u3068\u306e\u9023\u643a\u304c\u5897\u3048\u308b\u4e2d\u3001JSON\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u306f\u65e5\u5e38\u7684\u306a\u30bf\u30b9\u30af\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002PHP\u3067JSON\u30c7\u30fc\u30bf\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u52b9\u7387\u7684\u306b\u62bd\u51fa\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-62\">1. \u57fa\u672c\u7684\u306aJSON\u30c7\u30fc\u30bf\u51e6\u7406<\/h4>\n\n\n\n<p>JSON\u30c7\u30fc\u30bf\u306e\u57fa\u672c\u7684\u306a\u89e3\u6790\u3068\u60c5\u5831\u62bd\u51fa\u306e\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * API\u30ec\u30b9\u30dd\u30f3\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\n * @param string $jsonResponse JSON\u30ec\u30b9\u30dd\u30f3\u30b9\u6587\u5b57\u5217\n * @param string $path \u30c9\u30c3\u30c8\u533a\u5207\u308a\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30d1\u30b9\n * @return mixed \u62bd\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u3001\u898b\u3064\u304b\u3089\u306a\u3051\u308c\u3070null\n *\/\nfunction extractJsonData($jsonResponse, $path) {\n    \/\/ JSON\u30c7\u30b3\u30fc\u30c9\n    $data = json_decode($jsonResponse, true);\n    \n    \/\/ \u30c7\u30b3\u30fc\u30c9\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        throw new Exception(\"JSON\u89e3\u6790\u30a8\u30e9\u30fc: \" . json_last_error_msg());\n    }\n    \n    \/\/ \u30d1\u30b9\u304c\u7a7a\u306e\u5834\u5408\u306f\u30c7\u30fc\u30bf\u5168\u4f53\u3092\u8fd4\u3059\n    if (empty($path)) {\n        return $data;\n    }\n    \n    \/\/ \u30c9\u30c3\u30c8\u533a\u5207\u308a\u306e\u30d1\u30b9\u3092\u914d\u5217\u306b\u5206\u5272\n    $pathParts = explode('.', $path);\n    \n    \/\/ \u30d1\u30b9\u306b\u6cbf\u3063\u3066\u30c7\u30fc\u30bf\u3092\u8fbf\u308b\n    $current = $data;\n    foreach ($pathParts as $part) {\n        if (!isset($current[$part])) {\n            return null; \/\/ \u6307\u5b9a\u3055\u308c\u305f\u30d1\u30b9\u304c\u5b58\u5728\u3057\u306a\u3044\n        }\n        $current = $current[$part];\n    }\n    \n    return $current;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$apiResponse = '{\n    \"status\": \"success\",\n    \"data\": {\n        \"user\": {\n            \"id\": 123,\n            \"name\": \"\u5c71\u7530\u592a\u90ce\",\n            \"email\": \"yamada@example.com\",\n            \"addresses\": [\n                {\n                    \"type\": \"home\",\n                    \"zipcode\": \"123-4567\",\n                    \"prefecture\": \"\u6771\u4eac\u90fd\"\n                },\n                {\n                    \"type\": \"work\",\n                    \"zipcode\": \"567-8901\",\n                    \"prefecture\": \"\u795e\u5948\u5ddd\u770c\"\n                }\n            ]\n        },\n        \"subscription\": {\n            \"plan\": \"premium\",\n            \"expiry\": \"2023-12-31\"\n        }\n    }\n}';\n\ntry {\n    \/\/ \u30e6\u30fc\u30b6\u30fc\u540d\u3092\u62bd\u51fa\n    $userName = extractJsonData($apiResponse, 'data.user.name');\n    echo \"\u30e6\u30fc\u30b6\u30fc\u540d: $userName\\n\";\n    \n    \/\/ \u81ea\u5b85\u306e\u90f5\u4fbf\u756a\u53f7\u3092\u62bd\u51fa\uff08\u3088\u308a\u8907\u96d1\u306a\u30b1\u30fc\u30b9\uff09\n    $addresses = extractJsonData($apiResponse, 'data.user.addresses');\n    $homeZipcode = null;\n    \n    if ($addresses) {\n        foreach ($addresses as $address) {\n            if ($address['type'] === 'home') {\n                $homeZipcode = $address['zipcode'];\n                break;\n            }\n        }\n    }\n    \n    echo \"\u81ea\u5b85\u90f5\u4fbf\u756a\u53f7: \" . ($homeZipcode ?: '\u4e0d\u660e') . \"\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-63\">2. \u8907\u96d1\u306aJSON\u30c7\u30fc\u30bf\u3092\u6271\u3046\u305f\u3081\u306e\u30af\u30a8\u30ea\u30af\u30e9\u30b9<\/h4>\n\n\n\n<p>\u3088\u308a\u8907\u96d1\u306aJSON\u30c7\u30fc\u30bf\u3092\u67d4\u8edf\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u30af\u30a8\u30ea\u30af\u30e9\u30b9\u306e\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * JSON\u30c7\u30fc\u30bf\u3092\u30af\u30a8\u30ea\u3059\u308b\u305f\u3081\u306e\u30d8\u30eb\u30d1\u30fc\u30af\u30e9\u30b9\n *\/\nclass JsonQuery {\n    private $data;\n    \n    \/**\n     * \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\n     * @param string|array $json JSON\u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\n     *\/\n    public function __construct($json) {\n        if (is_string($json)) {\n            $this-&gt;data = json_decode($json, true);\n            if (json_last_error() !== JSON_ERROR_NONE) {\n                throw new Exception(\"JSON\u89e3\u6790\u30a8\u30e9\u30fc: \" . json_last_error_msg());\n            }\n        } elseif (is_array($json)) {\n            $this-&gt;data = $json;\n        } else {\n            throw new Exception(\"\u7121\u52b9\u306a\u5165\u529b: \u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\u304c\u5fc5\u8981\u3067\u3059\");\n        }\n    }\n    \n    \/**\n     * \u6307\u5b9a\u3055\u308c\u305f\u30d1\u30b9\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\n     * @param string $path \u30c9\u30c3\u30c8\u533a\u5207\u308a\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30d1\u30b9\n     * @param mixed $default \u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\n     * @return mixed \u62bd\u51fa\u3057\u305f\u30c7\u30fc\u30bf\u307e\u305f\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\n     *\/\n    public function get($path = null, $default = null) {\n        if ($path === null) {\n            return $this-&gt;data;\n        }\n        \n        $pathParts = explode('.', $path);\n        $current = $this-&gt;data;\n        \n        foreach ($pathParts as $part) {\n            \/\/ \u914d\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u7279\u5225\u306a\u8a18\u6cd5\uff08\u4f8b: items[0]\uff09\n            if (preg_match('\/^(.*?)\\[(\\d+)\\]$\/', $part, $matches)) {\n                $part = $matches[1];\n                $index = (int)$matches[2];\n                \n                if (!isset($current[$part]) || !isset($current[$part][$index])) {\n                    return $default;\n                }\n                \n                $current = $current[$part][$index];\n                continue;\n            }\n            \n            if (!isset($current[$part])) {\n                return $default;\n            }\n            \n            $current = $current[$part];\n        }\n        \n        return $current;\n    }\n    \n    \/**\n     * \u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u6700\u521d\u306e\u8981\u7d20\u3092\u691c\u7d22\n     * @param string $arrayPath \u691c\u7d22\u5bfe\u8c61\u306e\u914d\u5217\u306e\u30d1\u30b9\n     * @param array $conditions \u691c\u7d22\u6761\u4ef6 [\u30ad\u30fc =&gt; \u5024]\n     * @return mixed \u898b\u3064\u304b\u3063\u305f\u8981\u7d20\u307e\u305f\u306fnull\n     *\/\n    public function find($arrayPath, $conditions) {\n        $array = $this-&gt;get($arrayPath);\n        \n        if (!is_array($array)) {\n            return null;\n        }\n        \n        foreach ($array as $item) {\n            $match = true;\n            \n            foreach ($conditions as $key =&gt; $value) {\n                if (!isset($item[$key]) || $item[$key] !== $value) {\n                    $match = false;\n                    break;\n                }\n            }\n            \n            if ($match) {\n                return $item;\n            }\n        }\n        \n        return null;\n    }\n    \n    \/**\n     * \u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u8981\u7d20\u3092\u691c\u7d22\n     * @param string $arrayPath \u691c\u7d22\u5bfe\u8c61\u306e\u914d\u5217\u306e\u30d1\u30b9\n     * @param array $conditions \u691c\u7d22\u6761\u4ef6 [\u30ad\u30fc =&gt; \u5024]\n     * @return array \u898b\u3064\u304b\u3063\u305f\u8981\u7d20\u306e\u914d\u5217\n     *\/\n    public function findAll($arrayPath, $conditions) {\n        $array = $this-&gt;get($arrayPath);\n        $result = [];\n        \n        if (!is_array($array)) {\n            return $result;\n        }\n        \n        foreach ($array as $item) {\n            $match = true;\n            \n            foreach ($conditions as $key =&gt; $value) {\n                if (!isset($item[$key]) || $item[$key] !== $value) {\n                    $match = false;\n                    break;\n                }\n            }\n            \n            if ($match) {\n                $result[] = $item;\n            }\n        }\n        \n        return $result;\n    }\n    \n    \/**\n     * \u914d\u5217\u306e\u5404\u8981\u7d20\u304b\u3089\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3092\u62bd\u51fa\n     * @param string $arrayPath \u5bfe\u8c61\u914d\u5217\u306e\u30d1\u30b9\n     * @param string $keyField \u30ad\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\n     * @param string $valueField \u5024\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\n     * @return array \u62bd\u51fa\u3057\u305f [\u30ad\u30fc =&gt; \u5024] \u306e\u9023\u60f3\u914d\u5217\n     *\/\n    public function pluck($arrayPath, $keyField, $valueField) {\n        $array = $this-&gt;get($arrayPath);\n        $result = [];\n        \n        if (!is_array($array)) {\n            return $result;\n        }\n        \n        foreach ($array as $item) {\n            if (isset($item[$keyField]) &amp;&amp; isset($item[$valueField])) {\n                $result[$item[$keyField]] = $item[$valueField];\n            }\n        }\n        \n        return $result;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$apiResponse = '{\n    \"products\": [\n        {\n            \"id\": 101,\n            \"name\": \"\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\",\n            \"price\": 50000,\n            \"stock\": 120,\n            \"categories\": [\"\u96fb\u5316\u88fd\u54c1\", \"\u30e2\u30d0\u30a4\u30eb\"]\n        },\n        {\n            \"id\": 102,\n            \"name\": \"\u30ce\u30fc\u30c8\u30d1\u30bd\u30b3\u30f3\",\n            \"price\": 120000,\n            \"stock\": 50,\n            \"categories\": [\"\u96fb\u5316\u88fd\u54c1\", \"\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\"]\n        },\n        {\n            \"id\": 103,\n            \"name\": \"\u30ef\u30a4\u30e4\u30ec\u30b9\u30a4\u30e4\u30db\u30f3\",\n            \"price\": 15000,\n            \"stock\": 200,\n            \"categories\": [\"\u96fb\u5316\u88fd\u54c1\", \"\u30aa\u30fc\u30c7\u30a3\u30aa\", \"\u30e2\u30d0\u30a4\u30eb\"]\n        }\n    ],\n    \"metadata\": {\n        \"total\": 3,\n        \"page\": 1,\n        \"per_page\": 10\n    }\n}';\n\ntry {\n    $jq = new JsonQuery($apiResponse);\n    \n    \/\/ \u5168\u5546\u54c1\u3092\u53d6\u5f97\n    $products = $jq-&gt;get('products');\n    echo \"\u5546\u54c1\u6570: \" . count($products) . \"\\n\";\n    \n    \/\/ \u5358\u4e00\u306e\u5024\u3092\u53d6\u5f97\n    $totalProducts = $jq-&gt;get('metadata.total');\n    echo \"\u7dcf\u5546\u54c1\u6570: $totalProducts\\n\";\n    \n    \/\/ \u914d\u5217\u306e\u7279\u5b9a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u5f97\n    $firstProduct = $jq-&gt;get('products[0]');\n    echo \"\u6700\u521d\u306e\u5546\u54c1: \" . $firstProduct['name'] . \"\\n\";\n    \n    \/\/ \u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u5546\u54c1\u3092\u691c\u7d22\n    $laptop = $jq-&gt;find('products', ['name' =&gt; '\u30ce\u30fc\u30c8\u30d1\u30bd\u30b3\u30f3']);\n    if ($laptop) {\n        echo \"\u30ce\u30fc\u30c8\u30d1\u30bd\u30b3\u30f3\u306e\u4fa1\u683c: \" . number_format($laptop['price']) . \"\u5186\\n\";\n    }\n    \n    \/\/ \u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u5546\u54c1\u3092\u691c\u7d22\n    $mobileProducts = [];\n    foreach ($products as $product) {\n        if (in_array('\u30e2\u30d0\u30a4\u30eb', $product['categories'])) {\n            $mobileProducts[] = $product;\n        }\n    }\n    echo \"\u30e2\u30d0\u30a4\u30eb\u30ab\u30c6\u30b4\u30ea\u306e\u5546\u54c1\u6570: \" . count($mobileProducts) . \"\\n\";\n    \n    \/\/ ID\u2192\u5546\u54c1\u540d\u306e\u30de\u30c3\u30d7\u3092\u4f5c\u6210\n    $productNames = $jq-&gt;pluck('products', 'id', 'name');\n    echo \"ID 103\u306e\u5546\u54c1\u540d: \" . ($productNames[103] ?? '\u4e0d\u660e') . \"\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-64\">3. REST API\u304b\u3089\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\u3068\u51e6\u7406<\/h4>\n\n\n\n<p>\u5916\u90e8API\u304b\u3089\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\u3068\u51e6\u7406\u306e\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * REST API\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u51e6\u7406\u3059\u308b\n * @param string $url API\u306eURL\n * @param array $headers \u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u30fc\n * @return array \u51e6\u7406\u7d50\u679c\n *\/\nfunction fetchAndProcessApiData($url, $headers = []) {\n    \/\/ cURL\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u521d\u671f\u5316\n    $ch = curl_init($url);\n    \n    \/\/ cURL\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\n    curl_setopt_array($ch, [\n        CURLOPT_RETURNTRANSFER =&gt; true,\n        CURLOPT_HTTPHEADER =&gt; $headers,\n        CURLOPT_CONNECTTIMEOUT =&gt; 5,\n        CURLOPT_TIMEOUT =&gt; 10\n    ]);\n    \n    \/\/ \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u5b9f\u884c\n    $response = curl_exec($ch);\n    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n    \n    \/\/ \u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\n    if (curl_errno($ch)) {\n        throw new Exception(\"API\u63a5\u7d9a\u30a8\u30e9\u30fc: \" . curl_error($ch));\n    }\n    \n    curl_close($ch);\n    \n    \/\/ HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306e\u78ba\u8a8d\n    if ($httpCode &lt; 200 || $httpCode &gt;= 300) {\n        throw new Exception(\"API\u30a8\u30e9\u30fc: \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9 $httpCode\");\n    }\n    \n    \/\/ JSON\u30c7\u30fc\u30bf\u306e\u30c7\u30b3\u30fc\u30c9\n    $data = json_decode($response, true);\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        throw new Exception(\"JSON\u89e3\u6790\u30a8\u30e9\u30fc: \" . json_last_error_msg());\n    }\n    \n    return $data;\n}\n\n\/\/ \u4f7f\u7528\u4f8b: \u5929\u6c17API\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u51e6\u7406\ntry {\n    $apiKey = \"YOUR_API_KEY\";\n    $city = \"Tokyo\";\n    $url = \"https:\/\/api.example.com\/weather?city=\" . urlencode($city) . \"&amp;appid=\" . $apiKey;\n    \n    $headers = [\n        \"Accept: application\/json\",\n        \"User-Agent: PHPWeatherApp\/1.0\"\n    ];\n    \n    $weatherData = fetchAndProcessApiData($url, $headers);\n    \n    \/\/ JsonQuery\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u51e6\u7406\n    $jq = new JsonQuery($weatherData);\n    \n    $currentTemp = $jq-&gt;get('main.temp');\n    $humidity = $jq-&gt;get('main.humidity');\n    $weatherDesc = $jq-&gt;get('weather[0].description');\n    \n    echo \"$city \u306e\u73fe\u5728\u306e\u5929\u6c17:\\n\";\n    echo \"\u6c17\u6e29: {$currentTemp}\u00b0C\\n\";\n    echo \"\u6e7f\u5ea6: {$humidity}%\\n\";\n    echo \"\u5929\u6c17: $weatherDesc\\n\";\n    \n    \/\/ \u7279\u5b9a\u6761\u4ef6\u3067\u306e\u4e88\u5831\u62bd\u51fa\uff08\u4f8b: \u660e\u65e5\u306e\u6b63\u5348\u306e\u4e88\u5831\uff09\n    $forecasts = $jq-&gt;get('forecast.list');\n    $tomorrowNoon = null;\n    \n    if ($forecasts) {\n        $tomorrow = date('Y-m-d', strtotime('+1 day'));\n        \n        foreach ($forecasts as $forecast) {\n            $forecastTime = substr($forecast['dt_txt'], 0, 10);\n            $forecastHour = substr($forecast['dt_txt'], 11, 2);\n            \n            if ($forecastTime === $tomorrow &amp;&amp; $forecastHour === '12') {\n                $tomorrowNoon = $forecast;\n                break;\n            }\n        }\n    }\n    \n    if ($tomorrowNoon) {\n        echo \"\\n\u660e\u65e5\u306e\u6b63\u5348\u306e\u4e88\u5831:\\n\";\n        echo \"\u6c17\u6e29: \" . $tomorrowNoon['main']['temp'] . \"\u00b0C\\n\";\n        echo \"\u5929\u6c17: \" . $tomorrowNoon['weather'][0]['description'] . \"\\n\";\n    }\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5b9f\u8df5\u4f8b\u3092\u5fdc\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3055\u307e\u3056\u307e\u306a\u6587\u5b57\u5217\u51e6\u7406\u30bf\u30b9\u30af\u306b\u5bfe\u51e6\u3067\u304d\u307e\u3059\u3002\u5b9f\u52d9\u3067\u306f\u30c7\u30fc\u30bf\u306e\u578b\u3084\u69cb\u9020\u304c\u4e88\u6e2c\u3067\u304d\u306a\u3044\u5834\u5408\u3082\u591a\u3044\u305f\u3081\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3084\u5165\u529b\u691c\u8a3c\u3092\u9069\u5207\u306b\u884c\u3044\u3001\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u5fc3\u304c\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u307e\u305f\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u3067\u306f\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3082\u8003\u616e\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-65\">PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6d3b\u7528<\/h2>\n\n\n\n<p>PHP\u306e\u6a19\u6e96\u95a2\u6570\u3060\u3051\u3067\u3082\u6587\u5b57\u5217\u64cd\u4f5c\u306f\u53ef\u80fd\u3067\u3059\u304c\u3001\u3088\u308a\u9ad8\u5ea6\u3067\u67d4\u8edf\u306a\u51e6\u7406\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306b\u3001\u5c02\u7528\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001PHP\u3067\u5229\u7528\u3067\u304d\u308b\u4ee3\u8868\u7684\u306a\u6587\u5b57\u5217\u51e6\u7406\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3001\u72ec\u81ea\u306e\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-66\">Stringy\u3084Symfony String\u306a\u3069\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u7d39\u4ecb<\/h3>\n\n\n\n<p>PHP\u7528\u306e\u6587\u5b57\u5217\u51e6\u7406\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411API\u3001\u76f4\u611f\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u540d\u306a\u3069\u306e\u7279\u5fb4\u3092\u6301\u3064\u512a\u308c\u305f\u3082\u306e\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u7279\u306b\u4eba\u6c17\u306e\u9ad8\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-67\">1. Stringy\u30e9\u30a4\u30d6\u30e9\u30ea<\/h4>\n\n\n\n<p><a href=\"https:\/\/github.com\/danielstjules\/Stringy\">Stringy<\/a>\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u30d5\u30eb\u30fc\u30a8\u30f3\u30c8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u5f37\u529b\u306a\u6587\u5b57\u5217\u64cd\u4f5c\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5b8c\u5168\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u65e5\u672c\u8a9e\u306a\u3069\u306e\u51e6\u7406\u3082\u5b89\u5168\u306b\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">composer require danielstjules\/stringy\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u540d\u524d\u7a7a\u9593\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nuse Stringy\\Stringy as S;\n\n\/\/ \u6587\u5b57\u5217\u306e\u751f\u6210\n$stringy = S::create('\u3053\u3093\u306b\u3061\u306f\u4e16\u754c');\n\n\/\/ \u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u306b\u3088\u308b\u64cd\u4f5c\n$result = $stringy-&gt;substr(0, 5)\n                 -&gt;append('!')\n                 -&gt;toUpperCase()\n                 -&gt;toString();\n\necho $result; \/\/ \u300c\u3053\u3093\u306b\u3061\u306f!\u300d\uff08\u5927\u6587\u5b57\u5316\u306f\u65e5\u672c\u8a9e\u3067\u306f\u52b9\u679c\u306a\u3057\uff09\n\n\/\/ \u82f1\u8a9e\u306e\u4f8b\n$hello = S::create('hello world');\necho $hello-&gt;upperCaseFirst()-&gt;replace('world', 'PHP')-&gt;toString(); \/\/ \"Hello PHP\"\n<\/pre>\n\n\n\n<p><strong>\u4e3b\u8981\u30e1\u30bd\u30c3\u30c9<\/strong>:<\/p>\n\n\n<div id=\"id-7fae63d3-9a9a-4d9b-8b1e-6800c56d2f9b\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30e1\u30bd\u30c3\u30c9<\/th><th>\u8aac\u660e<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>append($string)<\/code><\/td><td>\u6587\u5b57\u5217\u3092\u672b\u5c3e\u306b\u8ffd\u52a0<\/td><td><code>S::create('Hello')-&gt;append(' World')<\/code><\/td><\/tr><tr><td><code>prepend($string)<\/code><\/td><td>\u6587\u5b57\u5217\u3092\u5148\u982d\u306b\u8ffd\u52a0<\/td><td><code>S::create('World')-&gt;prepend('Hello ')<\/code><\/td><\/tr><tr><td><code>contains($needle)<\/code><\/td><td>\u90e8\u5206\u6587\u5b57\u5217\u3092\u542b\u3080\u304b<\/td><td><code>S::create('Hello')-&gt;contains('lo')<\/code><\/td><\/tr><tr><td><code>indexOf($needle)<\/code><\/td><td>\u90e8\u5206\u6587\u5b57\u5217\u306e\u4f4d\u7f6e\u3092\u691c\u7d22<\/td><td><code>S::create('Hello')-&gt;indexOf('l')<\/code><\/td><\/tr><tr><td><code>upperCaseFirst()<\/code><\/td><td>\u5148\u982d\u3092\u5927\u6587\u5b57\u306b<\/td><td><code>S::create('hello')-&gt;upperCaseFirst()<\/code><\/td><\/tr><tr><td><code>camelize()<\/code><\/td><td>\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u306b\u5909\u63db<\/td><td><code>S::create('hello_world')-&gt;camelize()<\/code><\/td><\/tr><tr><td><code>underscored()<\/code><\/td><td>\u30b9\u30cd\u30fc\u30af\u30b1\u30fc\u30b9\u306b\u5909\u63db<\/td><td><code>S::create('helloWorld')-&gt;underscored()<\/code><\/td><\/tr><tr><td><code>slugify()<\/code><\/td><td>\u30b9\u30e9\u30b0\u306b\u5909\u63db<\/td><td><code>S::create('Hello World!')-&gt;slugify()<\/code><\/td><\/tr><tr><td><code>trim()<\/code><\/td><td>\u524d\u5f8c\u306e\u7a7a\u767d\u3092\u524a\u9664<\/td><td><code>S::create(' text ')-&gt;trim()<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>Stringy\u306e\u30e1\u30ea\u30c3\u30c8<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5b8c\u5168\u5bfe\u5fdc<\/li>\n\n\n\n<li>\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u67d4\u8edf\u306b\u6307\u5b9a\u53ef\u80fd<\/li>\n\n\n\n<li>\u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u306b\u3088\u308b\u76f4\u611f\u7684\u306a\u30b3\u30fc\u30c9\u8a18\u8ff0<\/li>\n\n\n\n<li>\u5e83\u7bc4\u306a\u6587\u5b57\u5217\u64cd\u4f5c\u30e1\u30bd\u30c3\u30c9<\/li>\n\n\n\n<li>\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3068\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u4e21\u65b9\u3092\u30b5\u30dd\u30fc\u30c8<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306e\u4f8b\n$length = S::length('\u3053\u3093\u306b\u3061\u306f'); \/\/ 5\n\n\/\/ \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u4f8b\n$s = S::create('\u3053\u3093\u306b\u3061\u306f');\n$length = $s-&gt;length(); \/\/ 5\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-68\">2. Symfony String Component<\/h4>\n\n\n\n<p><a href=\"https:\/\/symfony.com\/doc\/current\/components\/string.html\">Symfony String<\/a>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001Symfony\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u4e00\u90e8\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5358\u72ec\u3067\u3082\u4f7f\u7528\u3067\u304d\u308b\u5f37\u529b\u306a\u6587\u5b57\u5217\u64cd\u4f5c\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002Unicode\u5bfe\u5fdc\u304c\u7279\u306b\u512a\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">composer require symfony\/string\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\String\\UnicodeString;\n\n\/\/ UnicodeString\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\uff09\n$string = new UnicodeString('\u3053\u3093\u306b\u3061\u306f\u4e16\u754c');\n$result = $string-&gt;slice(0, 5)\n                -&gt;append('!')\n                -&gt;toString();\n\necho $result; \/\/ \u300c\u3053\u3093\u306b\u3061\u306f!\u300d\n\n\/\/ \u82f1\u8a9e\u306e\u4f8b\n$hello = new UnicodeString('hello world');\necho $hello-&gt;title()-&gt;replace('World', 'PHP'); \/\/ \"Hello PHP\"\n<\/pre>\n\n\n\n<p><strong>Symfony String\u306e\u7279\u5fb4<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>3\u3064\u306e\u6587\u5b57\u5217\u30af\u30e9\u30b9<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>ByteString<\/code>: \u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u7528<\/li>\n\n\n\n<li><code>CodePointString<\/code>: Unicode\u5bfe\u5fdc\uff08PHP\u62e1\u5f35\u4e0d\u8981\uff09<\/li>\n\n\n\n<li><code>UnicodeString<\/code>: \u5b8c\u5168\u306aUnicode\u64cd\u4f5c\uff08\u6700\u3082\u63a8\u5968\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u8c4a\u5bcc\u306a\u30e1\u30bd\u30c3\u30c9<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>match()<\/code>: \u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/li>\n\n\n\n<li><code>replaceMatches()<\/code>: \u6b63\u898f\u8868\u73fe\u306b\u3088\u308b\u7f6e\u63db<\/li>\n\n\n\n<li><code>wordwrap()<\/code>: \u5358\u8a9e\u5358\u4f4d\u3067\u306e\u6539\u884c<\/li>\n\n\n\n<li><code>width()<\/code>: \u8868\u793a\u5e45\u306e\u8a08\u7b97<\/li>\n\n\n\n<li><code>trimStart()<\/code>, <code>trimEnd()<\/code>: \u5148\u982d\/\u672b\u5c3e\u306e\u30c8\u30ea\u30e0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Symfony\\Component\\String\\UnicodeString;\n\n$text = new UnicodeString('The quick brown fox');\n\n\/\/ \u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\n$matches = $text-&gt;match('\/\\w{5}\/'); \/\/ [\"quick\", \"brown\"]\n\n\/\/ \u5358\u8a9e\u3092\u5909\u63db\n$transformed = $text-&gt;replaceMatches('\/\\b(\\w+)\\b\/', function ($match) {\n    return strlen($match[0]) &gt; 4 ? strtoupper($match[0]) : $match[0];\n});\necho $transformed; \/\/ \"The QUICK BROWN fox\"\n<\/pre>\n\n\n\n<p><strong>Symfony String\u306e\u5229\u70b9<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Symfony\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u3068\u306e\u7d71\u5408<\/li>\n\n\n\n<li>Unicode\u64cd\u4f5c\u306e\u9ad8\u5ea6\u306a\u30b5\u30dd\u30fc\u30c8<\/li>\n\n\n\n<li>PSR\u6a19\u6e96\u306b\u6e96\u62e0\u3057\u305f\u8a2d\u8a08<\/li>\n\n\n\n<li>\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\uff08\u4e0d\u5909\uff09\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/li>\n\n\n\n<li>PHP 7.2\u4ee5\u4e0a\u3067\u52d5\u4f5c<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-69\">3. Laravel Support\uff08Str\u30af\u30e9\u30b9\uff09<\/h4>\n\n\n\n<p><a href=\"https:\/\/laravel.com\/\">Laravel<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u7d44\u307f\u8fbc\u307e\u308c\u305f<code>Illuminate\\Support\\Str<\/code>\u30af\u30e9\u30b9\u304c\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002\u3053\u308c\u306f\u5358\u72ec\u3067\u3082\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/strong>\uff08Laravel\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u5916\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\uff09:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">composer require illuminate\/support\n<\/pre>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Illuminate\\Support\\Str;\n\n\/\/ \u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\n$slug = Str::slug('\u3053\u3093\u306b\u3061\u306f\u4e16\u754c'); \/\/ \"kon-ni-ti-ha-shi-jie\"\n$random = Str::random(16); \/\/ \u30e9\u30f3\u30c0\u30e0\u306a16\u6587\u5b57\u306e\u6587\u5b57\u5217\n\n\/\/ \u6587\u5b57\u5217\u64cd\u4f5c\n$truncated = Str::limit('This is a long text', 10); \/\/ \"This is a...\"\n$studly = Str::studly('hello_world'); \/\/ \"HelloWorld\"\n$snake = Str::snake('HelloWorld'); \/\/ \"hello_world\"\n\n\/\/ \u6761\u4ef6\u5224\u5b9a\nif (Str::startsWith('Hello World', 'Hello')) {\n    echo 'Yes!';\n}\n\nif (Str::contains('Hello World', 'World')) {\n    echo 'Found!';\n}\n<\/pre>\n\n\n\n<p><strong>Laravel\u306e\u6587\u5b57\u5217\u30d8\u30eb\u30d1\u30fc\u306e\u7279\u5fb4<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3001DB\u30af\u30a8\u30ea\u306a\u3069Laravel\u306e\u4ed6\u306e\u6a5f\u80fd\u3068\u306e\u9023\u643a<\/li>\n\n\n\n<li>\u30b0\u30ed\u30fc\u30d0\u30eb\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u63d0\u4f9b\uff08<code>str_*<\/code>\u95a2\u6570\u7fa4\uff09<\/li>\n\n\n\n<li>UUID\u751f\u6210\u306a\u3069\u306e\u4fbf\u5229\u6a5f\u80fd<\/li>\n\n\n\n<li>\u30b1\u30fc\u30b9\u5909\u63db\u30e1\u30bd\u30c3\u30c9\u304c\u8c4a\u5bcc\uff08camel, kebab, snake, studly\u306a\u3069\uff09<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-70\">\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u3092\u7c21\u7565\u5316\u3059\u308b\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u308f\u305a\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u56fa\u6709\u306e\u8981\u4ef6\u306b\u5408\u308f\u305b\u305f\u30ab\u30b9\u30bf\u30e0\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3082\u91cd\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u52b9\u7387\u7684\u3067\u518d\u5229\u7528\u53ef\u80fd\u306a\u6587\u5b57\u5217\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u5b9f\u88c5\u30d1\u30bf\u30fc\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-71\">1. \u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u95a2\u9023\u3059\u308b\u6587\u5b57\u5217\u64cd\u4f5c\u30e1\u30bd\u30c3\u30c9\u30921\u3064\u306e\u30af\u30e9\u30b9\u306b\u307e\u3068\u3081\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace App\\Utils;\n\nclass StringHelper\n{\n    \/**\n     * \u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u5fdc\u3057\u305f\u6587\u5b57\u5217\u5207\u308a\u8a70\u3081\n     * \n     * @param string $text \u5bfe\u8c61\u6587\u5b57\u5217\n     * @param int $length \u6700\u5927\u9577\uff08\u6587\u5b57\u6570\uff09\n     * @param string $suffix \u7701\u7565\u8a18\u53f7\n     * @return string \u5207\u308a\u8a70\u3081\u305f\u6587\u5b57\u5217\n     *\/\n    public static function truncate(string $text, int $length, string $suffix = '...'): string\n    {\n        if (mb_strlen($text) &lt;= $length) {\n            return $text;\n        }\n        \n        return mb_substr($text, 0, $length) . $suffix;\n    }\n    \n    \/**\n     * \u65e5\u672c\u8a9e\u7528\u306e\u30b9\u30e9\u30b0\u3092\u751f\u6210\uff08URL\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc\u306a\u6587\u5b57\u5217\uff09\n     * \n     * @param string $text \u5bfe\u8c61\u6587\u5b57\u5217\n     * @param string $separator \u533a\u5207\u308a\u6587\u5b57\n     * @return string \u30b9\u30e9\u30b0\n     *\/\n    public static function japaneseSlugify(string $text, string $separator = '-'): string\n    {\n        \/\/ \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u534a\u89d2\u306b\u5909\u63db\n        $text = mb_convert_kana($text, 's');\n        \n        \/\/ \u6fc1\u70b9\u30fb\u534a\u6fc1\u70b9\u3092\u5206\u89e3\uff08\u300c\u304c\u300d\u2192\u300c\u304b\u309b\u300d\uff09\u3057\u3066\u9664\u53bb\u3057\u3084\u3059\u304f\u3059\u308b\n        $text = mb_convert_kana($text, 'c');\n        \n        \/\/ \u30ed\u30fc\u30de\u5b57\u5909\u63db\uff08\u30d8\u30dc\u30f3\u5f0f\uff09\n        \/\/ \u6ce8: \u5b8c\u5168\u306a\u30d8\u30dc\u30f3\u5f0f\u5909\u63db\u306f\u8907\u96d1\u306a\u305f\u3081\u3001\u3053\u3053\u3067\u306f\u7c21\u6613\u7684\u306a\u4f8b\n        $romanMap = [\n            '\u3042' =&gt; 'a', '\u3044' =&gt; 'i', '\u3046' =&gt; 'u', '\u3048' =&gt; 'e', '\u304a' =&gt; 'o',\n            '\u304b' =&gt; 'ka', '\u304d' =&gt; 'ki', '\u304f' =&gt; 'ku', '\u3051' =&gt; 'ke', '\u3053' =&gt; 'ko',\n            \/\/ ... \u4ed6\u306e\u6587\u5b57\u3082\u540c\u69d8\u306b\u5b9a\u7fa9\n        ];\n        \n        $slug = '';\n        for ($i = 0; $i &lt; mb_strlen($text); $i++) {\n            $char = mb_substr($text, $i, 1);\n            $slug .= $romanMap[$char] ?? $char;\n        }\n        \n        \/\/ \u82f1\u6570\u5b57\u3068\u30bb\u30d1\u30ec\u30fc\u30bf\u4ee5\u5916\u3092\u9664\u53bb\n        $slug = preg_replace('\/[^a-z0-9]+\/', $separator, strtolower($slug));\n        \n        \/\/ \u5148\u982d\u3068\u672b\u5c3e\u306e\u30bb\u30d1\u30ec\u30fc\u30bf\u3092\u9664\u53bb\n        return trim($slug, $separator);\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u304b\u3089HTML\u30bf\u30b0\u3068\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b89\u5168\u306b\u9664\u53bb\n     * \n     * @param string $text \u5bfe\u8c61\u6587\u5b57\u5217\n     * @return string \u30af\u30ea\u30fc\u30f3\u306a\u30c6\u30ad\u30b9\u30c8\n     *\/\n    public static function stripHtml(string $text): string\n    {\n        \/\/ \u30b9\u30af\u30ea\u30d7\u30c8\u30bf\u30b0\u3068\u305d\u306e\u5185\u5bb9\u3092\u5148\u306b\u9664\u53bb\uff08strip_tags \u3067\u306f\u4e0d\u5341\u5206\u306a\u5834\u5408\u304c\u3042\u308b\uff09\n        $text = preg_replace('\/&lt;script\\b[^&gt;]*&gt;(.*?)&lt;\\\/script&gt;\/is', '', $text);\n        \n        \/\/ style \u30bf\u30b0\u306e\u9664\u53bb\n        $text = preg_replace('\/&lt;style\\b[^&gt;]*&gt;(.*?)&lt;\\\/style&gt;\/is', '', $text);\n        \n        \/\/ \u6b8b\u308a\u306e\u30bf\u30b0\u3092\u9664\u53bb\n        $text = strip_tags($text);\n        \n        \/\/ HTML \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3092\u30c7\u30b3\u30fc\u30c9\n        $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');\n        \n        \/\/ \u9023\u7d9a\u3059\u308b\u7a7a\u767d\u30921\u3064\u306b\n        $text = preg_replace('\/\\s+\/', ' ', $text);\n        \n        return trim($text);\n    }\n    \n    \/**\n     * \u65e5\u672c\u8a9e\u306e\u4f4f\u6240\u304b\u3089\u90f5\u4fbf\u756a\u53f7\u3092\u62bd\u51fa\n     * \n     * @param string $address \u4f4f\u6240\u6587\u5b57\u5217\n     * @return string|null \u90f5\u4fbf\u756a\u53f7\u307e\u305f\u306f null\n     *\/\n    public static function extractPostalCode(string $address): ?string\n    {\n        if (preg_match('\/\u3012?\\s*(\\d{3}-\\d{4})\/', $address, $matches)) {\n            return $matches[1];\n        }\n        \n        return null;\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u3092\u6307\u5b9a\u3055\u308c\u305f\u5e45\u3067\u6574\u5f62\uff08\u65e5\u672c\u8a9e\u5bfe\u5fdc\uff09\n     * \n     * @param string $text \u5bfe\u8c61\u6587\u5b57\u5217\n     * @param int $width \u5e45\uff08\u5168\u89d21\u6587\u5b57\u3042\u305f\u308a2\u3001\u534a\u89d21\u6587\u5b57\u3042\u305f\u308a1\u3068\u30ab\u30a6\u30f3\u30c8\uff09\n     * @return string \u6574\u5f62\u3055\u308c\u305f\u6587\u5b57\u5217\n     *\/\n    public static function mbWordwrap(string $text, int $width): string\n    {\n        $result = '';\n        $currentWidth = 0;\n        \n        for ($i = 0; $i &lt; mb_strlen($text); $i++) {\n            $char = mb_substr($text, $i, 1);\n            $charWidth = mb_strwidth($char);\n            \n            if ($currentWidth + $charWidth &gt; $width) {\n                $result .= PHP_EOL;\n                $currentWidth = 0;\n            }\n            \n            $result .= $char;\n            $currentWidth += $charWidth;\n        }\n        \n        return $result;\n    }\n}\n<\/pre>\n\n\n\n<p><strong>\u4f7f\u7528\u4f8b<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use App\\Utils\\StringHelper;\n\n$longText = \"\u3053\u308c\u306f\u975e\u5e38\u306b\u9577\u3044\u30c6\u30ad\u30b9\u30c8\u3067\u3001\u9069\u5207\u306a\u9577\u3055\u306b\u5207\u308a\u8a70\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\";\necho StringHelper::truncate($longText, 15); \/\/ \"\u3053\u308c\u306f\u975e\u5e38\u306b\u9577\u3044\u30c6\u30ad...\"\n\n$japaneseText = \"\u6771\u4eac\u90fd\u6e0b\u8c37\u533a\";\necho StringHelper::japaneseSlugify($japaneseText); \/\/ \"tokyo-to-shibuya-ku\"\n\n$htmlContent = \"&lt;p&gt;\u3053\u308c\u306f&lt;script&gt;alert('\u5371\u967a!');&lt;\/script&gt;&lt;b&gt;HTML\u30b3\u30f3\u30c6\u30f3\u30c4&lt;\/b&gt;\u3067\u3059\u3002&lt;\/p&gt;\";\necho StringHelper::stripHtml($htmlContent); \/\/ \"\u3053\u308c\u306fHTML\u30b3\u30f3\u30c6\u30f3\u30c4\u3067\u3059\u3002\"\n\n$address = \"\u3012123-4567 \u6771\u4eac\u90fd\u65b0\u5bbf\u533a\u897f\u65b0\u5bbf1-2-3\";\necho StringHelper::extractPostalCode($address); \/\/ \"123-4567\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-72\">2. \u30c8\u30ec\u30a4\u30c8\u3092\u4f7f\u3063\u305f\u6a5f\u80fd\u62e1\u5f35<\/h4>\n\n\n\n<p>\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u306b\u6587\u5b57\u5217\u51e6\u7406\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u30c8\u30ec\u30a4\u30c8\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace App\\Traits;\n\ntrait StringManipulation\n{\n    \/**\n     * \u6587\u5b57\u5217\u3092\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3067\u30de\u30b9\u30af\n     * \n     * @param string $text \u30de\u30b9\u30af\u3059\u308b\u6587\u5b57\u5217\n     * @param int $visibleStart \u5148\u982d\u304b\u3089\u8868\u793a\u3059\u308b\u6587\u5b57\u6570\n     * @param int $visibleEnd \u672b\u5c3e\u304b\u3089\u8868\u793a\u3059\u308b\u6587\u5b57\u6570\n     * @param string $maskChar \u30de\u30b9\u30af\u6587\u5b57\n     * @return string \u30de\u30b9\u30af\u3055\u308c\u305f\u6587\u5b57\u5217\n     *\/\n    public function maskString(string $text, int $visibleStart = 1, int $visibleEnd = 1, string $maskChar = '*'): string\n    {\n        $textLength = mb_strlen($text);\n        \n        if ($textLength &lt;= $visibleStart + $visibleEnd) {\n            return $text;\n        }\n        \n        $start = mb_substr($text, 0, $visibleStart);\n        $end = mb_substr($text, -$visibleEnd, $visibleEnd);\n        $masked = str_repeat($maskChar, $textLength - $visibleStart - $visibleEnd);\n        \n        return $start . $masked . $end;\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u3092\u6307\u5b9a\u3055\u308c\u305f\u9577\u3055\u306b\u5207\u308a\u8a70\u3081\u3001\u4f4d\u7f6e\u306b\u3088\u3063\u3066\u8868\u793a\u30b9\u30bf\u30a4\u30eb\u3092\u5909\u3048\u308b\n     * \n     * @param string $text \u5bfe\u8c61\u6587\u5b57\u5217\n     * @param int $maxLength \u6700\u5927\u9577\uff08\u6587\u5b57\u6570\uff09\n     * @param string $position \u5207\u308a\u8a70\u3081\u4f4d\u7f6e\uff08'start', 'middle', 'end'\uff09\n     * @param string $suffix \u7701\u7565\u8a18\u53f7\n     * @return string \u6574\u5f62\u3055\u308c\u305f\u6587\u5b57\u5217\n     *\/\n    public function smartTruncate(string $text, int $maxLength, string $position = 'end', string $suffix = '...'): string\n    {\n        $textLength = mb_strlen($text);\n        \n        if ($textLength &lt;= $maxLength) {\n            return $text;\n        }\n        \n        $suffixLength = mb_strlen($suffix);\n        $maxLength = max(1, $maxLength - $suffixLength);\n        \n        switch ($position) {\n            case 'start':\n                \/\/ \u5148\u982d\u3092\u7701\u7565\uff08...\u5f8c\u534a\u90e8\u5206\uff09\n                return $suffix . mb_substr($text, $textLength - $maxLength);\n                \n            case 'middle':\n                \/\/ \u4e2d\u592e\u3092\u7701\u7565\uff08\u524d\u534a...\u5f8c\u534a\uff09\n                $leftLength = (int)ceil($maxLength \/ 2);\n                $rightLength = $maxLength - $leftLength;\n                return mb_substr($text, 0, $leftLength) . $suffix . mb_substr($text, -$rightLength);\n                \n            case 'end':\n            default:\n                \/\/ \u672b\u5c3e\u3092\u7701\u7565\uff08\u524d\u534a\u90e8\u5206...\uff09\n                return mb_substr($text, 0, $maxLength) . $suffix;\n        }\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u3092\u8a9e\u5f59\u7684\u306b\u6bd4\u8f03\uff08\u81ea\u7136\u9806\u30bd\u30fc\u30c8\u7528\uff09\n     * \n     * @param string $a \u6bd4\u8f03\u6587\u5b57\u52171\n     * @param string $b \u6bd4\u8f03\u6587\u5b57\u52172\n     * @return int \u6bd4\u8f03\u7d50\u679c\uff08\u8ca0\u30010\u3001\u6b63\uff09\n     *\/\n    public function naturalCompare(string $a, string $b): int\n    {\n        return strnatcmp($a, $b);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nclass TextProcessor\n{\n    use StringManipulation;\n    \n    public function processText(string $text, array $options = []): string\n    {\n        \/\/ \u30c8\u30ec\u30a4\u30c8\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\n        $text = $this-&gt;maskString($text, $options['visibleStart'] ?? 2, $options['visibleEnd'] ?? 2);\n        $text = $this-&gt;smartTruncate($text, $options['maxLength'] ?? 50, $options['truncatePosition'] ?? 'end');\n        \n        return $text;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$processor = new TextProcessor();\necho $processor-&gt;maskString(\"example@example.com\", 3, 4); \/\/ \"exa*********com\"\necho $processor-&gt;smartTruncate(\"\u3053\u308c\u306f\u975e\u5e38\u306b\u9577\u3044\u30c6\u30ad\u30b9\u30c8\u3067\u3059\", 10, 'middle'); \/\/ \"\u3053\u308c\u306f\u975e...\u30b9\u30c8\u3067\u3059\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-73\">3. \u540d\u524d\u7a7a\u9593\u5316\u3057\u305f\u30b0\u30ed\u30fc\u30d0\u30eb\u95a2\u6570\u7fa4<\/h4>\n\n\n\n<p>\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3001\u540d\u524d\u7a7a\u9593\u3067\u6574\u7406\u3057\u305f\u95a2\u6570\u7fa4\u3092\u63d0\u4f9b\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ src\/Utils\/string_helpers.php\n\nnamespace App\\Utils;\n\n\/**\n * \u6307\u5b9a\u3057\u305f\u9577\u3055\u3067\u30c6\u30ad\u30b9\u30c8\u3092\u7c21\u6f54\u306b\u5207\u308a\u8a70\u3081\u308b\n *\/\nfunction str_truncate(string $text, int $length, string $suffix = '...'): string\n{\n    if (mb_strlen($text) &lt;= $length) {\n        return $text;\n    }\n    \n    return mb_substr($text, 0, $length) . $suffix;\n}\n\n\/**\n * \u6587\u5b57\u5217\u3092\u30b9\u30cd\u30fc\u30af\u30b1\u30fc\u30b9\u306b\u5909\u63db\n *\/\nfunction to_snake_case(string $input): string\n{\n    \/\/ \u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u3084\u4ed6\u306e\u66f8\u5f0f\u304b\u3089\u306e\u5909\u63db\n    $result = preg_replace('\/([a-z])([A-Z])\/', '$1_$2', $input);\n    $result = str_replace(['-', ' '], '_', $result);\n    return mb_strtolower($result);\n}\n\n\/**\n * \u6587\u5b57\u5217\u3092\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u306b\u5909\u63db\n *\/\nfunction to_camel_case(string $input): string\n{\n    \/\/ \u30b9\u30cd\u30fc\u30af\u30b1\u30fc\u30b9\u3084\u30b1\u30d0\u30d6\u30b1\u30fc\u30b9\u304b\u3089\u306e\u5909\u63db\n    $result = str_replace(['-', '_'], ' ', $input);\n    $result = ucwords($result);\n    $result = str_replace(' ', '', $result);\n    return lcfirst($result);\n}\n\n\/**\n * \u6587\u5b57\u5217\u5185\u306e\u7279\u5b9a\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\n *\/\nfunction highlight_keywords(string $text, array $keywords, string $before = '&lt;strong&gt;', string $after = '&lt;\/strong&gt;'): string\n{\n    if (empty($keywords)) {\n        return $text;\n    }\n    \n    \/\/ \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u3066\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306b\u5909\u63db\n    $patterns = array_map(function($keyword) {\n        return '\/(' . preg_quote($keyword, '\/') . ')\/iu';\n    }, $keywords);\n    \n    \/\/ \u5404\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\n    $replacements = array_map(function($keyword) use ($before, $after) {\n        return $before . '$1' . $after;\n    }, $keywords);\n    \n    return preg_replace($patterns, $replacements, $text);\n}\n\n\/**\n * \u65e5\u672c\u8a9e\u3092\u542b\u3080\u6587\u5b57\u5217\u3092URL\u30bb\u30fc\u30d5\u306a\u30b9\u30e9\u30b0\u306b\u5909\u63db\n *\/\nfunction slugify(string $text, string $separator = '-'): string\n{\n    \/\/ \u5168\u89d2\u304b\u3089\u534a\u89d2\u3078\u5909\u63db\n    $text = mb_convert_kana($text, 'as');\n    \n    \/\/ \u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3068\u3057\u3066\u6271\u3048\u308b\u6587\u5b57\u306b\u7f6e\u63db\n    $text = preg_replace('\/[^\\p{L}\\p{N}]+\/u', $separator, $text);\n    $text = mb_strtolower($text);\n    \n    \/\/ \u9023\u7d9a\u3059\u308b\u30bb\u30d1\u30ec\u30fc\u30bf\u3092\u5358\u4e00\u306b\n    $text = preg_replace('\/' . preg_quote($separator) . '{2,}\/', $separator, $text);\n    \n    \/\/ \u5148\u982d\u3068\u672b\u5c3e\u306e\u30bb\u30d1\u30ec\u30fc\u30bf\u3092\u9664\u53bb\n    return trim($text, $separator);\n}\n\n\/\/ -------------------\n\/\/ \u4f7f\u7528\u4f8b\uff08composer \u306e\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u305f\u5834\u5408\uff09\n\/\/ -------------------\n\n\/\/ composer.json \u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0:\n\/\/ \"autoload\": {\n\/\/     \"files\": [\"src\/Utils\/string_helpers.php\"]\n\/\/ }\n\n\/\/ \u4f7f\u7528\u4f8b:\nuse function App\\Utils\\{str_truncate, highlight_keywords, slugify};\n\n$text = \"PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\";\necho str_truncate($text, 10); \/\/ \"PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0...\"\n\n$highlighted = highlight_keywords(\n    \"PHP\u306f\u5f37\u529b\u306aWeb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\",\n    [\"PHP\", \"Web\", \"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\"],\n    '&lt;span class=\"highlight\"&gt;', '&lt;\/span&gt;'\n);\n\/\/ \u51fa\u529b: \"&lt;span class=\"highlight\"&gt;PHP&lt;\/span&gt;\u306f\u5f37\u529b\u306a&lt;span class=\"highlight\"&gt;Web&lt;\/span&gt;&lt;span class=\"highlight\"&gt;\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0&lt;\/span&gt;\u8a00\u8a9e\u3067\u3059\"\n\n$slug = slugify(\"\u6771\u4eac\u90fd \u65b0\u5bbf\u533a \u897f\u65b0\u5bbf1-2-3\");\n\/\/ \u51fa\u529b: \"tokyo-to-shinjuku-ku-nishishinjuku1-2-3\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-74\">4. \u30e2\u30b8\u30e5\u30e9\u30fc\u306a\u8a2d\u8a08\u306b\u3088\u308b\u62e1\u5f35\u6027\u306e\u78ba\u4fdd<\/h4>\n\n\n\n<p>\u51e6\u7406\u5185\u5bb9\u306b\u3088\u3063\u3066\u30af\u30e9\u30b9\u3092\u5206\u5272\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u8a2d\u8a08\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ src\/Text\/Formatter.php\nnamespace App\\Text;\n\nclass Formatter\n{\n    \/**\n     * \u6587\u5b57\u5217\u3092\u5207\u308a\u8a70\u3081\u308b\n     *\/\n    public function truncate(string $text, int $length, string $suffix = '...'): string\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n    \n    \/**\n     * \u6587\u5b57\u5217\u306e\u30b1\u30fc\u30b9\u3092\u5909\u63db\n     *\/\n    public function convertCase(string $text, string $case = 'lower'): string\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n}\n\n\/\/ src\/Text\/Sanitizer.php\nnamespace App\\Text;\n\nclass Sanitizer\n{\n    \/**\n     * HTML\u30bf\u30b0\u3092\u9664\u53bb\n     *\/\n    public function stripTags(string $html, array $allowedTags = []): string\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n    \n    \/**\n     * \u5371\u967a\u306a\u6587\u5b57\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\n     *\/\n    public function escape(string $text, string $context = 'html'): string\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n}\n\n\/\/ src\/Text\/Analyzer.php\nnamespace App\\Text;\n\nclass Analyzer\n{\n    \/**\n     * \u30c6\u30ad\u30b9\u30c8\u306e\u7d71\u8a08\u60c5\u5831\u3092\u53d6\u5f97\n     *\/\n    public function getStats(string $text): array\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n    \n    \/**\n     * \u985e\u4f3c\u5ea6\u3092\u8a08\u7b97\n     *\/\n    public function calculateSimilarity(string $text1, string $text2): float\n    {\n        \/\/ \u5b9f\u88c5\u5185\u5bb9\n    }\n}\n\n\/\/ src\/Text\/Manager.php\nnamespace App\\Text;\n\nclass Manager\n{\n    private $formatter;\n    private $sanitizer;\n    private $analyzer;\n    \n    public function __construct(\n        Formatter $formatter,\n        Sanitizer $sanitizer,\n        Analyzer $analyzer\n    ) {\n        $this-&gt;formatter = $formatter;\n        $this-&gt;sanitizer = $sanitizer;\n        $this-&gt;analyzer = $analyzer;\n    }\n    \n    \/**\n     * \u4e00\u9023\u306e\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u3092\u5b9f\u884c\n     *\/\n    public function process(string $text, array $options = []): string\n    {\n        \/\/ \u30b5\u30cb\u30bf\u30a4\u30ba\n        if (!empty($options['sanitize'])) {\n            $text = $this-&gt;sanitizer-&gt;stripTags($text, $options['allowedTags'] ?? []);\n        }\n        \n        \/\/ \u30d5\u30a9\u30fc\u30de\u30c3\u30c8\n        if (!empty($options['truncate'])) {\n            $text = $this-&gt;formatter-&gt;truncate($text, $options['maxLength'] ?? 100);\n        }\n        \n        return $text;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$manager = new Manager(\n    new Formatter(),\n    new Sanitizer(),\n    new Analyzer()\n);\n\n$processedText = $manager-&gt;process(\n    \"&lt;p&gt;\u3053\u308c\u306f&lt;script&gt;alert('XSS');&lt;\/script&gt;\u30b5\u30f3\u30d7\u30eb\u30c6\u30ad\u30b9\u30c8\u3067\u3059\u3002&lt;\/p&gt;\",\n    [\n        'sanitize' =&gt; true,\n        'truncate' =&gt; true,\n        'maxLength' =&gt; 10\n    ]\n);\n\necho $processedText; \/\/ \"\u3053\u308c\u306f\u30b5\u30f3\u30d7\u30eb...\"\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u6700\u9069\u306a\u6587\u5b57\u5217\u51e6\u7406\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u81ea\u4f5c\u306e\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u67d4\u8edf\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-75\">\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u5f15\u304d\u4e0a\u3052\u308b\u305f\u3081\u306b<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3001PHP\u3067\u306e\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u306b\u95a2\u3059\u308b\u57fa\u672c\u304b\u3089\u5fdc\u7528\u307e\u3067\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u5b66\u3093\u3067\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u6280\u8853\u306e\u7fd2\u5f97\u306f\u7d99\u7d9a\u7684\u306a\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u30b9\u30ad\u30eb\u3092\u3055\u3089\u306b\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9\u3084\u5b9f\u8df5\u7684\u306a\u30a2\u30c9\u30d0\u30a4\u30b9\u3001\u305d\u3057\u3066\u5b9f\u52d9\u306b\u304a\u3051\u308b\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u624b\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-76\">\u3088\u308a\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2\u30ea\u30bd\u30fc\u30b9<\/h3>\n\n\n\n<p>PHP\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u9054\u4eba\u306b\u306a\u308b\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u30ea\u30bd\u30fc\u30b9\u3092\u6d3b\u7528\u3057\u3066\u7d99\u7d9a\u7684\u306b\u5b66\u7fd2\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-77\">1. \u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3068\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/h4>\n\n\n\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3001\u6700\u3082\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u60c5\u5831\u6e90\u3067\u3059\u3002\u7279\u306b\u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u6df1\u304f\u7406\u89e3\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/ref.strings.php\">PHP\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb\uff1a\u6587\u5b57\u5217\u95a2\u6570<\/a>\n<ul class=\"wp-block-list\">\n<li>\u5168\u3066\u306e\u6a19\u6e96\u6587\u5b57\u5217\u95a2\u6570\u306e\u8a73\u7d30\u306a\u4f7f\u7528\u65b9\u6cd5\u3084\u6ce8\u610f\u70b9\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/book.mbstring.php\">PHP\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb\uff1a\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217<\/a>\n<ul class=\"wp-block-list\">\n<li>\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u51e6\u7406\u306b\u4e0d\u53ef\u6b20\u306a\u95a2\u6570\u7fa4<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/book.pcre.php\">PHP\u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb\uff1a\u6b63\u898f\u8868\u73fe<\/a>\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u306e\u305f\u3081\u306e\u5b8c\u5168\u30ac\u30a4\u30c9<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30dd\u30a4\u30f3\u30c8<\/strong>: \u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u8aad\u3080\u969b\u306f\u3001\u95a2\u6570\u306e\u8aac\u660e\u3060\u3051\u3067\u306a\u304f\u3001\u4f8b\u3084\u30e6\u30fc\u30b6\u30fc\u30b3\u30e1\u30f3\u30c8\u3001\u300c\u6ce8\u610f\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u3082\u6ce8\u76ee\u3057\u307e\u3057\u3087\u3046\u3002\u591a\u304f\u306e\u5834\u5408\u3001\u5b9f\u52d9\u3067\u906d\u9047\u3059\u308b\u554f\u984c\u306e\u89e3\u6c7a\u7b56\u304c\u305d\u3053\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-78\">2. \u66f8\u7c4d\u3068\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9<\/h4>\n\n\n\n<p>\u5c02\u9580\u66f8\u7c4d\u3084\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9\u306f\u3001\u4f53\u7cfb\u7684\u306b\u77e5\u8b58\u3092\u7fd2\u5f97\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u66f8\u7c4d<\/strong>:\n<ul class=\"wp-block-list\">\n<li>\u300ePHP\u5b9f\u8df5\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300f\uff08SB\u30af\u30ea\u30a8\u30a4\u30c6\u30a3\u30d6\uff09<\/li>\n\n\n\n<li>\u300eModern PHP\u300f\uff08O\u2019Reilly\uff09<\/li>\n\n\n\n<li>\u300ePHP 7 \u5b9f\u8df5\u5165\u9580\u300f\uff08\u6280\u8853\u8a55\u8ad6\u793e\uff09<\/li>\n\n\n\n<li>\u300e\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0PHP\u300f\uff08\u7fd4\u6cf3\u793e\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30b9<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Laracasts\uff08https:\/\/laracasts.com\uff09- PHP\u3068Laravel\u306b\u95a2\u3059\u308b\u9ad8\u54c1\u8cea\u306a\u30d3\u30c7\u30aa\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/li>\n\n\n\n<li>Udemy \u2013 \u300ePHP\u6587\u5b57\u5217\u64cd\u4f5c\u30de\u30b9\u30bf\u30fc\u30b3\u30fc\u30b9\u300f\u306a\u3069\u306e\u5c02\u9580\u30b3\u30fc\u30b9<\/li>\n\n\n\n<li>Coursera \u2013 \u300eWeb Applications for Everybody\u300f\uff08\u30df\u30b7\u30ac\u30f3\u5927\u5b66\uff09<\/li>\n\n\n\n<li>Progate, Codecademy \u2013 \u521d\u5fc3\u8005\u5411\u3051\u306e\u5bfe\u8a71\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-79\">3. \u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3068\u30d5\u30a9\u30fc\u30e9\u30e0<\/h4>\n\n\n\n<p>\u554f\u984c\u89e3\u6c7a\u3084\u6700\u65b0\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306e\u628a\u63e1\u306b\u306f\u3001\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3078\u306e\u53c2\u52a0\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/php\">Stack Overflow<\/a> \u2013 \u30bf\u30b0\u300cphp\u300d\u300cstring\u300d\u3067\u691c\u7d22<\/li>\n\n\n\n<li><a href=\"https:\/\/www.php.net\/support.php\">PHP.net IRC Channel<\/a> \u2013 \u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u8cea\u554f\u30fb\u56de\u7b54<\/li>\n\n\n\n<li><a href=\"https:\/\/www.reddit.com\/r\/PHP\/\">Reddit r\/PHP<\/a> \u2013 \u30c7\u30a3\u30b9\u30ab\u30c3\u30b7\u30e7\u30f3\u3068\u30ea\u30bd\u30fc\u30b9\u5171\u6709<\/li>\n\n\n\n<li><a href=\"https:\/\/www.facebook.com\/groups\/1396356100677970\/\">PHP Developers Japan<\/a> \u2013 \u65e5\u672c\u306ePHP\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\uff08Facebook\uff09<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-80\">4. \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u30e9\u30a4\u30d6\u30e9\u30ea<\/h4>\n\n\n\n<p>\u512a\u308c\u305f\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u3053\u3068\u306f\u3001\u5b66\u7fd2\u306e\u6700\u826f\u306e\u65b9\u6cd5\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/symfony\/string\">Symfony String Component<\/a> \u2013 \u6587\u5b57\u5217\u51e6\u7406\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/laravel\/framework\">Laravel Framework<\/a> \u2013 <code>Illuminate\\Support\\Str<\/code>\u30af\u30e9\u30b9<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/thephpleague\">PHP League Packages<\/a> \u2013 \u7279\u306b<code>csv<\/code>\u3084<code>commonmark<\/code>\u306a\u3069\u306e\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5b9f\u8df5\u7684\u306a\u30a2\u30c9\u30d0\u30a4\u30b9<\/strong>: \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5b66\u3076\u969b\u306f\u3001\u5358\u306b\u4f7f\u7528\u65b9\u6cd5\u3092\u5b66\u3076\u3060\u3051\u3067\u306a\u304f\u3001\u5b9f\u969b\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3067\u5185\u90e8\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u4ed6\u306e\u958b\u767a\u8005\u304c\u3069\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u69cb\u9020\u5316\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u554f\u984c\u306b\u5bfe\u51e6\u3057\u3066\u3044\u308b\u304b\u3092\u5b66\u3079\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-81\">\u5b9f\u52d9\u306b\u304a\u3051\u308bPHP\u6587\u5b57\u5217\u51e6\u7406\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u624b\u6cd5<\/h3>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u6587\u5b57\u5217\u51e6\u7406\u306b\u95a2\u9023\u3059\u308b\u3055\u307e\u3056\u307e\u306a\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u52b9\u7387\u7684\u306a\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u624b\u6cd5\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u8fc5\u901f\u306b\u89e3\u6c7a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-82\">1. \u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u95a2\u9023\u306e\u554f\u984c<\/h4>\n\n\n\n<p>\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306f\u3001\u7279\u306b\u591a\u8a00\u8a9e\u5bfe\u5fdc\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u6700\u3082\u4e00\u822c\u7684\u306a\u554f\u984c\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u822c\u7684\u306a\u75c7\u72b6<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u65e5\u672c\u8a9e\u3084\u305d\u306e\u4ed6\u306e\u975eASCII\u6587\u5b57\u304c\u6587\u5b57\u5316\u3051\u3059\u308b<\/li>\n\n\n\n<li>\u6587\u5b57\u5217\u306e\u9577\u3055\u304c\u4e88\u671f\u3057\u306a\u3044\u5024\u306b\u306a\u308b<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u4fdd\u5b58\u6642\u307e\u305f\u306f\u8aad\u307f\u8fbc\u307f\u6642\u306b\u6587\u5b57\u304c\u7834\u640d\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<p><strong>\u89e3\u6c7a\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u78ba\u8a8d\u30c4\u30fc\u30eb<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function debugEncoding($string) {\n    $encodings = [\n        'UTF-8', 'SJIS', 'EUC-JP', 'ASCII', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-15'\n    ];\n    \n    echo \"\u6587\u5b57\u5217: \" . htmlspecialchars($string) . \"\\n\";\n    echo \"\u30d0\u30a4\u30c8\u9577: \" . strlen($string) . \" \u30d0\u30a4\u30c8\\n\";\n    echo \"\u6587\u5b57\u6570: \" . mb_strlen($string) . \" \u6587\u5b57\\n\";\n    echo \"\u30d0\u30a4\u30ca\u30ea\u8868\u73fe: \" . bin2hex($string) . \"\\n\";\n    \n    echo \"\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u691c\u51fa\u7d50\u679c:\\n\";\n    foreach ($encodings as $enc) {\n        $isValid = mb_check_encoding($string, $enc);\n        $detected = mb_detect_encoding($string, $enc, true);\n        echo \"- $enc: \" . ($isValid ? \"\u6709\u52b9\" : \"\u7121\u52b9\") . \n             ($detected === $enc ? \" (\u691c\u51fa\u3055\u308c\u305f)\" : \"\") . \"\\n\";\n    }\n    \n    \/\/ \u5404\u30d0\u30a4\u30c8\u306e\u8a73\u7d30\u8868\u793a\n    echo \"\u5404\u30d0\u30a4\u30c8\u306e\u8a73\u7d30:\\n\";\n    for ($i = 0; $i &lt; strlen($string); $i++) {\n        $byte = ord($string[$i]);\n        $hex = sprintf('%02X', $byte);\n        $char = ($byte &gt;= 32 &amp;&amp; $byte &lt;= 126) ? $string[$i] : '.';\n        echo \"$i: Byte=$byte, Hex=$hex, Char='$char'\\n\";\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"\u3053\u3093\u306b\u3061\u306f\";\ndebugEncoding($text);\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u7d71\u4e00<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5148\u982d\u3067\u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\nmb_internal_encoding('UTF-8');\nmb_http_output('UTF-8');\nmb_regex_encoding('UTF-8');\n\n\/\/ \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\n$pdo = new PDO('mysql:host=localhost;dbname=mydb;charset=utf8mb4', 'user', 'pass');\n\n\/\/ \u51fa\u529b\u524d\u306b\u5e38\u306b\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u78ba\u8a8d\u30fb\u5909\u63db\nfunction ensureUtf8($string) {\n    $encoding = mb_detect_encoding($string, ['UTF-8', 'SJIS', 'EUC-JP', 'ISO-8859-1'], true);\n    if ($encoding !== 'UTF-8') {\n        return mb_convert_encoding($string, 'UTF-8', $encoding);\n    }\n    return $string;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-83\">2. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u554f\u984c<\/h4>\n\n\n\n<p>\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3084\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3055\u308c\u308b\u6587\u5b57\u5217\u64cd\u4f5c\u3067\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u554f\u984c\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u822c\u7684\u306a\u75c7\u72b6<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7279\u5b9a\u306e\u6587\u5b57\u5217\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u308b\u3068\u51e6\u7406\u901f\u5ea6\u304c\u8457\u3057\u304f\u4f4e\u4e0b\u3059\u308b<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u6025\u5897\u3059\u308b<\/li>\n\n\n\n<li>\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b<\/li>\n<\/ul>\n\n\n\n<p><strong>\u89e3\u6c7a\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8a08\u6e2c<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function benchmarkStringFunction($functionName, $string, $iterations = 1000) {\n    $startTime = microtime(true);\n    $startMemory = memory_get_usage();\n    \n    for ($i = 0; $i &lt; $iterations; $i++) {\n        $result = $functionName($string);\n    }\n    \n    $endTime = microtime(true);\n    $endMemory = memory_get_usage();\n    \n    return [\n        'function' =&gt; $functionName,\n        'time' =&gt; ($endTime - $startTime) * 1000, \/\/ \u30df\u30ea\u79d2\n        'memory' =&gt; $endMemory - $startMemory,\n        'iterations' =&gt; $iterations\n    ];\n}\n\n\/\/ \u4f7f\u7528\u4f8b\uff1astrtr vs str_replace \u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03\n$text = str_repeat(\"The quick brown fox jumps over the lazy dog. \", 1000);\n\n$replace = function($str) {\n    return str_replace(\n        ['quick', 'brown', 'fox', 'dog'],\n        ['fast', 'black', 'wolf', 'cat'],\n        $str\n    );\n};\n\n$translate = function($str) {\n    return strtr($str, [\n        'quick' =&gt; 'fast',\n        'brown' =&gt; 'black',\n        'fox' =&gt; 'wolf',\n        'dog' =&gt; 'cat'\n    ]);\n};\n\n$result1 = benchmarkStringFunction($replace, $text);\n$result2 = benchmarkStringFunction($translate, $text);\n\necho \"{$result1['function']} - \u6642\u9593: {$result1['time']}ms, \u30e1\u30e2\u30ea: {$result1['memory']} bytes\\n\";\necho \"{$result2['function']} - \u6642\u9593: {$result2['time']}ms, \u30e1\u30e2\u30ea: {$result2['memory']} bytes\\n\";\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u6b63\u898f\u8868\u73fe\u306e\u6700\u9069\u5316<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u975e\u52b9\u7387\u306a\u6b63\u898f\u8868\u73fe\n$pattern1 = '\/a.*b.*c\/';  \/\/ \u904e\u5270\u306a\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\n\n\/\/ \u6700\u9069\u5316\u3055\u308c\u305f\u6b63\u898f\u8868\u73fe\n$pattern2 = '\/a[^c]*b[^c]*c\/';  \/\/ \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u524a\u6e1b\n\n\/\/ \u307e\u305f\u306f\u3001\u975e\u8caa\u6b32\u4fee\u98fe\u5b50\u3092\u4f7f\u7528\n$pattern3 = '\/a.*?b.*?c\/';  \/\/ \u6700\u5c0f\u30de\u30c3\u30c1\u306b\u3059\u308b\u3053\u3068\u3067\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u524a\u6e1b\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u5927\u91cf\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u306e\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u30e1\u30e2\u30ea\u3092\u5927\u91cf\u6d88\u8cbb\uff09\n$content = file_get_contents('large_file.txt');\n$processed = str_replace('search', 'replace', $content);\nfile_put_contents('processed_file.txt', $processed);\n\n\/\/ \u826f\u3044\u4f8b\uff08\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u51e6\u7406\uff09\n$input = fopen('large_file.txt', 'r');\n$output = fopen('processed_file.txt', 'w');\n\nwhile (!feof($input)) {\n    $line = fgets($input);\n    fputs($output, str_replace('search', 'replace', $line));\n}\n\nfclose($input);\nfclose($output);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-84\">3. \u6b63\u898f\u8868\u73fe\u306e\u30c7\u30d0\u30c3\u30b0<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u975e\u5e38\u306b\u5f37\u529b\u3067\u3059\u304c\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u96e3\u3057\u3044\u3053\u3068\u3067\u3082\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u822c\u7684\u306a\u75c7\u72b6<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e88\u671f\u3057\u306a\u3044\u30de\u30c3\u30c1\u30f3\u30b0\u7d50\u679c<\/li>\n\n\n\n<li>\u51e6\u7406\u901f\u5ea6\u306e\u6975\u7aef\u306a\u4f4e\u4e0b<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u30a8\u30e9\u30fc<\/li>\n<\/ul>\n\n\n\n<p><strong>\u89e3\u6c7a\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u306e\u6d3b\u7528<\/strong>:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/regex101.com\/\">regex101.com<\/a> \u2013 PCRE\u30e2\u30fc\u30c9\u3067PHP\u3068\u4e92\u63db\u6027\u306e\u3042\u308b\u6b63\u898f\u8868\u73fe\u3092\u30c6\u30b9\u30c8<\/li>\n\n\n\n<li><a href=\"https:\/\/regexr.com\/\">regexr.com<\/a> \u2013 \u6b63\u898f\u8868\u73fe\u306e\u30c7\u30d0\u30c3\u30b0\u3068\u5b66\u7fd2<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6bb5\u968e\u7684\u30c6\u30b9\u30c8<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function debugRegex($pattern, $subject, $flags = 0) {\n    echo \"\u30d1\u30bf\u30fc\u30f3: $pattern\\n\";\n    echo \"\u5bfe\u8c61\u6587\u5b57\u5217: \" . substr($subject, 0, 100) . (strlen($subject) &gt; 100 ? \"...\" : \"\") . \"\\n\";\n    \n    $startTime = microtime(true);\n    $result = preg_match($pattern, $subject, $matches, $flags);\n    $endTime = microtime(true);\n    \n    echo \"\u5b9f\u884c\u6642\u9593: \" . number_format(($endTime - $startTime) * 1000, 2) . \"ms\\n\";\n    \n    if ($result === false) {\n        echo \"\u30a8\u30e9\u30fc: \" . preg_last_error_msg() . \" (\u30b3\u30fc\u30c9: \" . preg_last_error() . \")\\n\";\n    } elseif ($result === 0) {\n        echo \"\u30de\u30c3\u30c1\u306a\u3057\\n\";\n    } else {\n        echo \"\u30de\u30c3\u30c1\u7d50\u679c:\\n\";\n        print_r($matches);\n    }\n    \n    echo \"----------------------------\\n\";\n}\n\n\/\/ \u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u3092\u6bb5\u968e\u7684\u306b\u30c7\u30d0\u30c3\u30b0\n$text = \"\u30e6\u30fc\u30b6\u30fc\u540d: johndoe, \u30e1\u30fc\u30eb: john.doe@example.com, \u96fb\u8a71: 090-1234-5678\";\n\ndebugRegex('\/\u30e6\u30fc\u30b6\u30fc\u540d:\\s*([^,]+)\/', $text);\ndebugRegex('\/\u30e1\u30fc\u30eb:\\s*([\\w.]+@[\\w.]+)\/', $text);\ndebugRegex('\/\u96fb\u8a71:\\s*(\\d{2,4}-\\d{2,4}-\\d{4})\/', $text);\n\n\/\/ \u8907\u5408\u30d1\u30bf\u30fc\u30f3\ndebugRegex('\/\u30e6\u30fc\u30b6\u30fc\u540d:\\s*([^,]+),\\s*\u30e1\u30fc\u30eb:\\s*([\\w.]+@[\\w.]+)\/', $text);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-85\">\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30b9\u30ad\u30eb\u3092\u6b21\u306e\u30ec\u30d9\u30eb\u306b\u5f15\u304d\u4e0a\u3052\u308b\u305f\u3081\u306e\u5b9f\u8df5\u30a8\u30af\u30b5\u30b5\u30a4\u30ba<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u5b9f\u8df5\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u30a8\u30af\u30b5\u30b5\u30a4\u30ba\u306b\u53d6\u308a\u7d44\u3080\u3053\u3068\u3067\u3001\u6587\u5b57\u5217\u51e6\u7406\u30b9\u30ad\u30eb\u3092\u78e8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-86\">1. \u72ec\u81ea\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3092\u4f5c\u308b<\/h4>\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u6d3b\u7528\u3057\u3066\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class SimpleTemplateEngine {\n    private $templateDir;\n    \n    public function __construct($templateDir) {\n        $this-&gt;templateDir = rtrim($templateDir, '\/') . '\/';\n    }\n    \n    public function render($template, $variables = []) {\n        $templatePath = $this-&gt;templateDir . $template;\n        \n        if (!file_exists($templatePath)) {\n            throw new Exception(\"Template not found: $template\");\n        }\n        \n        $content = file_get_contents($templatePath);\n        \n        \/\/ \u5909\u6570\u7f6e\u63db (\u4f8b: {{name}} \u2192 John)\n        $content = preg_replace_callback('\/\\{\\{([^}]+)\\}\\}\/', function($matches) use ($variables) {\n            $key = trim($matches[1]);\n            return $variables[$key] ?? '';\n        }, $content);\n        \n        \/\/ \u6761\u4ef6\u6587 (\u4f8b: {% if isAdmin %}\u7ba1\u7406\u8005\u30e1\u30cb\u30e5\u30fc{% endif %})\n        $content = preg_replace_callback('\/\\{%\\s*if\\s+([^%]+)\\s*%\\}(.*?)\\{%\\s*endif\\s*%\\}\/s', function($matches) use ($variables) {\n            $condition = trim($matches[1]);\n            $body = $matches[2];\n            \n            \/\/ \u5358\u7d14\u306a\u5909\u6570\u306e\u771f\u507d\u5024\u30c1\u30a7\u30c3\u30af\n            return isset($variables[$condition]) &amp;&amp; $variables[$condition] ? $body : '';\n        }, $content);\n        \n        \/\/ \u30eb\u30fc\u30d7 (\u4f8b: {% for item in items %}{{item}}{% endfor %})\n        $content = preg_replace_callback('\/\\{%\\s*for\\s+([a-zA-Z0-9_]+)\\s+in\\s+([a-zA-Z0-9_]+)\\s*%\\}(.*?)\\{%\\s*endfor\\s*%\\}\/s', function($matches) use ($variables) {\n            $itemVar = trim($matches[1]);\n            $arrayVar = trim($matches[2]);\n            $body = $matches[3];\n            $result = '';\n            \n            if (isset($variables[$arrayVar]) &amp;&amp; is_array($variables[$arrayVar])) {\n                foreach ($variables[$arrayVar] as $item) {\n                    \/\/ \u30a2\u30a4\u30c6\u30e0\u5909\u6570\u3092\u7f6e\u63db\n                    $itemContent = str_replace('{{' . $itemVar . '}}', $item, $body);\n                    $result .= $itemContent;\n                }\n            }\n            \n            return $result;\n        }, $content);\n        \n        return $content;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$engine = new SimpleTemplateEngine(__DIR__ . '\/templates');\n\n\/\/ template.html \u306e\u5185\u5bb9:\n\/\/ &lt;h1&gt;Welcome, {{name}}!&lt;\/h1&gt;\n\/\/ {% if isAdmin %}\n\/\/ &lt;div class=\"admin-panel\"&gt;\u7ba1\u7406\u8005\u30d1\u30cd\u30eb&lt;\/div&gt;\n\/\/ {% endif %}\n\/\/ &lt;ul&gt;\n\/\/ {% for item in items %}\n\/\/   &lt;li&gt;{{item}}&lt;\/li&gt;\n\/\/ {% endfor %}\n\/\/ &lt;\/ul&gt;\n\necho $engine-&gt;render('template.html', [\n    'name' =&gt; 'John',\n    'isAdmin' =&gt; true,\n    'items' =&gt; ['Item 1', 'Item 2', 'Item 3']\n]);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-87\">2. \u30de\u30fc\u30af\u30c0\u30a6\u30f3\u30d1\u30fc\u30b5\u30fc\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u8a18\u6cd5\u3092HTML\u306b\u5909\u63db\u3059\u308b\u7c21\u6613\u30d1\u30fc\u30b5\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u306e\u30b9\u30ad\u30eb\u3092\u78e8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class SimpleMarkdownParser {\n    public function parse($markdown) {\n        $html = $markdown;\n        \n        \/\/ \u6bb5\u843d\n        $html = preg_replace('\/(.+?)(\\n\\n|$)\/s', \"&lt;p&gt;$1&lt;\/p&gt;\", $html);\n        \n        \/\/ \u898b\u51fa\u3057\n        $html = preg_replace('\/^# (.+?)$\/m', \"&lt;h1&gt;$1&lt;\/h1&gt;\", $html);\n        $html = preg_replace('\/^## (.+?)$\/m', \"&lt;h2&gt;$1&lt;\/h2&gt;\", $html);\n        $html = preg_replace('\/^### (.+?)$\/m', \"&lt;h3&gt;$1&lt;\/h3&gt;\", $html);\n        \n        \/\/ \u592a\u5b57\n        $html = preg_replace('\/\\*\\*(.+?)\\*\\*\/s', \"&lt;strong&gt;$1&lt;\/strong&gt;\", $html);\n        \n        \/\/ \u659c\u4f53\n        $html = preg_replace('\/\\*(.+?)\\*\/s', \"&lt;em&gt;$1&lt;\/em&gt;\", $html);\n        \n        \/\/ \u30ea\u30f3\u30af\n        $html = preg_replace('\/\\[(.+?)\\]\\((.+?)\\)\/', '&lt;a href=\"$2\"&gt;$1&lt;\/a&gt;', $html);\n        \n        \/\/ \u30ea\u30b9\u30c8\n        $html = preg_replace('\/^- (.+?)$\/m', \"&lt;li&gt;$1&lt;\/li&gt;\", $html);\n        $html = preg_replace('\/(&lt;li&gt;.+?&lt;\\\/li&gt;)(\\s*)(&lt;li&gt;.+?&lt;\\\/li&gt;)\/s', \"$1$3\", $html);\n        $html = preg_replace('\/(&lt;li&gt;.+?&lt;\\\/li&gt;)+\/s', \"&lt;ul&gt;$0&lt;\/ul&gt;\", $html);\n        \n        return $html;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$parser = new SimpleMarkdownParser();\n$markdown = &lt;&lt;&lt;'MARKDOWN'\n# Markdown Example\n\nThis is a **bold** text with *italic* words.\n\n## Links\n\nCheck out [PHP.net](https:\/\/www.php.net)\n\n### List\n\n- Item 1\n- Item 2\n- Item 3\nMARKDOWN;\n\necho $parser-&gt;parse($markdown);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-88\">3. \u30b7\u30f3\u30d7\u30eb\u306aCSV\u30d1\u30fc\u30b5\u30fc<\/h4>\n\n\n\n<p>CSV\u30d5\u30a1\u30a4\u30eb\u306f\u69d8\u3005\u306a\u30c7\u30fc\u30bf\u4ea4\u63db\u3067\u4f7f\u308f\u308c\u308b\u4e00\u822c\u7684\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002\u72ec\u81ea\u306eCSV\u30d1\u30fc\u30b5\u30fc\u3092\u4f5c\u308b\u3053\u3068\u3067\u3001\u6587\u5b57\u5217\u64cd\u4f5c\u30b9\u30ad\u30eb\u3092\u5411\u4e0a\u3055\u305b\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class CsvParser {\n    private $delimiter;\n    private $enclosure;\n    private $escape;\n    \n    public function __construct($delimiter = ',', $enclosure = '\"', $escape = '\\\\') {\n        $this-&gt;delimiter = $delimiter;\n        $this-&gt;enclosure = $enclosure;\n        $this-&gt;escape = $escape;\n    }\n    \n    public function parse($csvString) {\n        $lines = explode(\"\\n\", trim($csvString));\n        $data = [];\n        \n        foreach ($lines as $line) {\n            if (empty(trim($line))) {\n                continue;\n            }\n            \n            $row = $this-&gt;parseLine($line);\n            $data[] = $row;\n        }\n        \n        return $data;\n    }\n    \n    public function parseWithHeaders($csvString) {\n        $lines = explode(\"\\n\", trim($csvString));\n        if (empty($lines)) {\n            return [];\n        }\n        \n        $headers = $this-&gt;parseLine($lines[0]);\n        $data = [];\n        \n        for ($i = 1; $i &lt; count($lines); $i++) {\n            $line = $lines[$i];\n            if (empty(trim($line))) {\n                continue;\n            }\n            \n            $row = $this-&gt;parseLine($line);\n            $rowData = [];\n            \n            foreach ($headers as $index =&gt; $header) {\n                $rowData[$header] = $row[$index] ?? '';\n            }\n            \n            $data[] = $rowData;\n        }\n        \n        return $data;\n    }\n    \n    private function parseLine($line) {\n        $chars = mb_str_split($line);\n        $result = [];\n        $currentField = '';\n        $inQuotes = false;\n        \n        foreach ($chars as $i =&gt; $char) {\n            \/\/ \u30a8\u30b9\u30b1\u30fc\u30d7\u6587\u5b57\u306e\u51e6\u7406\n            if ($char === $this-&gt;escape &amp;&amp; isset($chars[$i + 1]) &amp;&amp; \n                ($chars[$i + 1] === $this-&gt;enclosure || $chars[$i + 1] === $this-&gt;escape)) {\n                $currentField .= $chars[$i + 1];\n                $i++; \/\/ \u6b21\u306e\u6587\u5b57\u3092\u30b9\u30ad\u30c3\u30d7\n                continue;\n            }\n            \n            \/\/ \u5f15\u7528\u7b26\u5185\u306e\u5834\u5408\n            if ($inQuotes) {\n                if ($char === $this-&gt;enclosure) {\n                    \/\/ \u5f15\u7528\u7b26\u306e\u7d42\u308f\u308a\n                    $inQuotes = false;\n                } else {\n                    $currentField .= $char;\n                }\n                continue;\n            }\n            \n            \/\/ \u5f15\u7528\u7b26\u5916\u306e\u5834\u5408\n            if ($char === $this-&gt;enclosure) {\n                \/\/ \u5f15\u7528\u7b26\u306e\u59cb\u307e\u308a\n                $inQuotes = true;\n            } elseif ($char === $this-&gt;delimiter) {\n                \/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u533a\u5207\u308a\n                $result[] = $currentField;\n                $currentField = '';\n            } else {\n                $currentField .= $char;\n            }\n        }\n        \n        \/\/ \u6700\u5f8c\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\n        $result[] = $currentField;\n        \n        return $result;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$csv = &lt;&lt;&lt;'CSV'\nName,Email,Phone\n\"John, Doe\",john.doe@example.com,123-456-7890\nJane Doe,jane@example.com,\"555-1212\"\n\"Smith, Joe\",\"joe@example.com\",\"800-555-1000\"\nCSV;\n\n$parser = new CsvParser();\n$data = $parser-&gt;parseWithHeaders($csv);\n\necho \"CSV\u89e3\u6790\u7d50\u679c:\\n\";\nprint_r($data);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-89\">\u307e\u3068\u3081\uff1aPHP\u306e\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u30de\u30b9\u30bf\u30fc\u3078\u306e\u9053<\/h3>\n\n\n\n<p>PHP\u6587\u5b57\u5217\u51e6\u7406\u306e\u7fd2\u5f97\u306f\u3001Web\u958b\u767a\u8005\u3068\u3057\u3066\u975e\u5e38\u306b\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u30bb\u30c3\u30c8\u3067\u3059\u3002\u672c\u8a18\u4e8b\u3067\u5b66\u3093\u306010\u306e\u5fc5\u9808\u30c6\u30af\u30cb\u30c3\u30af\u3092\u632f\u308a\u8fd4\u308a\u3001\u30b9\u30ad\u30eb\u5411\u4e0a\u306e\u305f\u3081\u306e\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-90\">\u672c\u8a18\u4e8b\u3067\u5b66\u3093\u306010\u306e\u5fc5\u9808\u30c6\u30af\u30cb\u30c3\u30af<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5207\u308a\u51fa\u3057\u95a2\u6570<\/strong> \u2013 substr()\u3084explode()\u306a\u3069\u306e\u57fa\u672c\u95a2\u6570\u306e\u4f7f\u3044\u3053\u306a\u3057<\/li>\n\n\n\n<li><strong>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306e\u5b89\u5168\u306a\u51e6\u7406<\/strong> \u2013 mb_string\u95a2\u6570\u7fa4\u306b\u3088\u308b\u6b63\u78ba\u306a\u6587\u5b57\u64cd\u4f5c<\/li>\n\n\n\n<li><strong>\u6b63\u898f\u8868\u73fe\u306b\u3088\u308b\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/strong> \u2013 preg_*\u95a2\u6570\u306b\u3088\u308b\u67d4\u8edf\u306a\u62bd\u51fa<\/li>\n\n\n\n<li><strong>\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/strong> \u2013 \u30e1\u30e2\u30ea\u3068CPU\u52b9\u7387\u3092\u8003\u616e\u3057\u305f\u5b9f\u88c5<\/li>\n\n\n\n<li><strong>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u306e\u56de\u907f<\/strong> \u2013 \u5b89\u5168\u306a\u5165\u529b\u51e6\u7406\u3068\u51fa\u529b\u30a8\u30b9\u30b1\u30fc\u30d7<\/li>\n\n\n\n<li><strong>\u5b9f\u52d9\u7684\u306a\u30c7\u30fc\u30bf\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/strong> \u2013 CSV\u3001HTML\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u304b\u3089\u306e\u30c7\u30fc\u30bf\u53d6\u5f97<\/li>\n\n\n\n<li><strong>\u5c02\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6d3b\u7528<\/strong> \u2013 Stringy\u3084Symfony String\u306a\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u6d3b\u7528<\/li>\n\n\n\n<li><strong>\u30ab\u30b9\u30bf\u30e0\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u5b9f\u88c5<\/strong> \u2013 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u56fa\u6709\u306e\u6587\u5b57\u5217\u51e6\u7406\u95a2\u6570\u4f5c\u6210<\/li>\n\n\n\n<li><strong>URL\u3001HTML\u3001\u65e5\u4ed8\u306a\u3069\u306e\u7279\u6b8a\u30c7\u30fc\u30bf\u51e6\u7406<\/strong> \u2013 \u7279\u5b9a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u7279\u5316\u3057\u305f\u51e6\u7406<\/li>\n\n\n\n<li><strong>\u30a8\u30e9\u30fc\u51e6\u7406\u3068\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/strong> \u2013 \u554f\u984c\u306e\u8a3a\u65ad\u3068\u89e3\u6c7a\u65b9\u6cd5<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-91\">\u5b9f\u8df5\u3092\u901a\u3058\u3066\u30b9\u30ad\u30eb\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u65e2\u5b58\u306e\u512a\u308c\u305f\u30b3\u30fc\u30c9\u3092\u8aad\u3080<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u4eba\u6c17\u306e\u3042\u308b\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u3001\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u5b66\u3073\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li>\u7279\u306b\u6587\u5b57\u5217\u51e6\u7406\u306b\u7279\u5316\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u8cb4\u91cd\u306a\u5b66\u7fd2\u6750\u6599\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u5c0f\u3055\u306a\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f5c\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u6587\u5b57\u5217\u64cd\u4f5c\u306b\u95a2\u3059\u308b\u5c0f\u3055\u306a\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u3084\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li>\u4f8b: URL\u30d1\u30fc\u30b5\u30fc\u3001\u30c6\u30ad\u30b9\u30c8\u6b63\u898f\u5316\u30c4\u30fc\u30eb\u3001\u30b3\u30fc\u30c9\u30d5\u30a9\u30fc\u30de\u30c3\u30bf\u30fc\u306a\u3069<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30c1\u30e3\u30ec\u30f3\u30b8\u306b\u6311\u6226\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/leetcode.com\/\">LeetCode<\/a>\u3084<a href=\"https:\/\/www.hackerrank.com\/\">HackerRank<\/a>\u306a\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30c1\u30e3\u30ec\u30f3\u30b8\u30b5\u30a4\u30c8\u3067\u6587\u5b57\u5217\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u554f\u984c\u306b\u53d6\u308a\u7d44\u307f\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6700\u65b0\u306ePHP\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>PHP 8.0\u4ee5\u964d\u3067\u8ffd\u52a0\u3055\u308c\u305f\u65b0\u3057\u3044\u6587\u5b57\u5217\u95a2\u6570\uff08str_contains(), str_starts_with(), str_ends_with()\u306a\u3069\uff09\u3092\u7a4d\u6975\u7684\u306b\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u578b\u5ba3\u8a00\u3068\u9759\u7684\u89e3\u6790\u3092\u6d3b\u7528\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>PHPStan\u3084Psalm\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u3088\u308a\u5805\u7262\u306a\u6587\u5b57\u5217\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u7fd2\u6163\u3092\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u6587\u5b57\u5217\u51e6\u7406\u306e\u30b9\u30ad\u30eb\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u57fa\u790e\u3067\u3042\u308a\u3001\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2\u3068\u5b9f\u8df5\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u5b66\u3093\u3060\u30c6\u30af\u30cb\u30c3\u30af\u3092\u65e5\u3005\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u6d3b\u7528\u3057\u3001\u3055\u3089\u306b\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u51e6\u7406\u306e\u9054\u4eba\u3092\u76ee\u6307\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":{"0":"post-3470","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3470"}],"version-history":[{"count":1,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3470\/revisions"}],"predecessor-version":[{"id":3471,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3470\/revisions\/3471"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}