{"id":3775,"date":"2025-04-25T11:11:42","date_gmt":"2025-04-25T02:11:42","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3775"},"modified":"2025-04-25T11:11:44","modified_gmt":"2025-04-25T02:11:44","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%86%e5%89%b2%e3%82%92%e6%a5%b5%e3%82%81%e3%82%8b10%e3%81%ae%e5%ae%9f%e8%b7%b5%e3%83%86","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3775","title":{"rendered":"\u3010\u5b8c\u5168\u30ac\u30a4\u30c9\u3011PHP\u3067\u6587\u5b57\u5217\u5206\u5272\u3092\u6975\u3081\u308b10\u306e\u5b9f\u8df5\u30c6\u30af\u30cb\u30c3\u30af \u2014 \u521d\u5fc3\u8005\u304b\u3089\u4e0a\u7d1a\u8005\u307e\u3067"},"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\u5206\u5272\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">\u6587\u5b57\u5217\u5206\u5272\u304c\u5fc5\u8981\u306b\u306a\u308b\u30b7\u30fc\u30f3\u3068\u306f\uff1f<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u306e\u7279\u5fb4\u3092\u7406\u89e3\u3057\u3088\u3046<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-3\">\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u3068\u305d\u306e\u4f7f\u3044\u65b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-4\">explode()\u95a2\u6570\u3067\u30c7\u30ea\u30df\u30bf\u3092\u4f7f\u3063\u305f\u7c21\u5358\u5206\u5272<\/a>      <\/li>      <li>        <a href=\"#i-5\">str_split()\u95a2\u6570\u3067\u7b49\u9593\u9694\u306b\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-6\">preg_split()\u95a2\u6570\u3067\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u5206\u5272<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-7\">\u4f7f\u3044\u5206\u3051\u306e\u76ee\u5b89<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-8\">\u65e5\u672c\u8a9e\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff09\u306e\u6587\u5b57\u5217\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-9\">mb_split()\u95a2\u6570\u3092\u4f7f\u3063\u305f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u5206\u5272\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-10\">\u6587\u5b57\u5316\u3051\u3092\u9632\u3050\u305f\u3081\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\u306e\u91cd\u8981\u6027<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-11\">\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272\u3059\u308b\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-12\">\u5b9f\u8df5\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af5\u9078<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-13\">CSV\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u4f8b<\/a>      <\/li>      <li>        <a href=\"#i-17\">URL\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u62bd\u51fa\u3068\u5206\u89e3\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li>        <a href=\"#i-21\">\u8907\u6570\u306e\u30c7\u30ea\u30df\u30bf\u3092\u4f7f\u3063\u305f\u8907\u96d1\u306a\u6587\u5b57\u5217\u306e\u5206\u5272\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-24\">JSON\u6587\u5b57\u5217\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u9ad8\u5ea6\u306a\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-28\">\u5927\u5bb9\u91cf\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3059\u308b\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-32\">\u6587\u5b57\u5217\u5206\u5272\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-33\">\u5404\u5206\u5272\u95a2\u6570\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03<\/a>      <\/li>      <li>        <a href=\"#i-34\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6291\u3048\u308b\u52b9\u7387\u7684\u306a\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li>        <a href=\"#i-38\">\u51e6\u7406\u901f\u5ea6\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-43\">\u6700\u9069\u5316\u306e\u305f\u3081\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-44\">\u6587\u5b57\u5217\u5206\u5272\u306b\u304a\u3051\u308b\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-45\">Null\u5024\u3084\u7a7a\u6587\u5b57\u306e\u9069\u5207\u306a\u51e6\u7406\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-50\">\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u95a2\u9023\u3059\u308b\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-55\">\u9577\u5927\u306a\u6587\u5b57\u5217\u3092\u6271\u3046\u969b\u306e\u6ce8\u610f\u70b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-59\">PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u5225\u306e\u6587\u5b57\u5217\u5206\u5272\u6a5f\u80fd\u306e\u9055\u3044<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-60\">PHP 7.x\u30688.x\u3067\u306e\u65b0\u6a5f\u80fd\u3068\u6539\u5584\u70b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-64\">\u4e0b\u4f4d\u4e92\u63db\u6027\u3092\u4fdd\u3061\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u6700\u65b0\u5316\u3059\u308b\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-70\">\u5b9f\u7528\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u30e6\u30fc\u30b9\u30b1\u30fc\u30b93\u9078<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-71\">Web\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u5165\u529b\u30c7\u30fc\u30bf\u306e\u9069\u5207\u306a\u51e6\u7406\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-74\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6587\u5b57\u5217\u306e\u52b9\u7387\u7684\u306a\u5206\u5272\u3068\u52a0\u5de5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-77\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u89e3\u6790\u3068\u5fc5\u8981\u30c7\u30fc\u30bf\u306e\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-80\">\u6587\u5b57\u5217\u5206\u5272\u306e\u5fdc\u7528\uff1a\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-81\">\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u6301\u3064\u6587\u5b57\u5217\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-87\">\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3092\u6d3b\u7528\u3057\u305f\u67d4\u8edf\u306a\u6587\u5b57\u5217\u5206\u5272<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-92\">\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u30b3\u30c4<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-100\">\u307e\u3068\u3081\uff1a\u72b6\u6cc1\u306b\u5fdc\u3058\u305f\u6700\u9069\u306a\u6587\u5b57\u5217\u5206\u5272\u624b\u6cd5\u306e\u9078\u3073\u65b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-101\">\u30b7\u30ca\u30ea\u30aa\u5225\u304a\u3059\u3059\u3081\u5206\u5272\u95a2\u6570\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-108\">\u3055\u3089\u306a\u308b\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u306e\u305f\u3081\u306e\u53c2\u8003\u30ea\u30bd\u30fc\u30b9<\/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\u5206\u5272\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3044\u3066\u6587\u5b57\u5217\u64cd\u4f5c\u306f\u6700\u3082\u57fa\u672c\u7684\u304b\u3064\u91cd\u8981\u306a\u51e6\u7406\u306e\u4e00\u3064\u3067\u3059\u3002\u7279\u306b\u300c\u6587\u5b57\u5217\u5206\u5272\u300d\u306f\u3001\u65e5\u5e38\u7684\u306a\u958b\u767a\u4f5c\u696d\u3067\u983b\u7e41\u306b\u5fc5\u8981\u3068\u306a\u308b\u6280\u8853\u3067\u3059\u3002PHP\u306b\u306f\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u9069\u5207\u306a\u65b9\u6cd5\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u958b\u767a\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">\u6587\u5b57\u5217\u5206\u5272\u304c\u5fc5\u8981\u306b\u306a\u308b\u30b7\u30fc\u30f3\u3068\u306f\uff1f<\/h3>\n\n\n\n<p>\u6587\u5b57\u5217\u5206\u5272\u306f\u3001\u4e88\u60f3\u4ee5\u4e0a\u306b\u591a\u304f\u306e\u5834\u9762\u3067\u6d3b\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30fc\u30f3\u3067\u983b\u7e41\u306b\u5229\u7528\u3055\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>CSV\u30d5\u30a1\u30a4\u30eb\u306e\u89e3\u6790<\/strong>: \u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30c7\u30fc\u30bf\u3092\u500b\u5225\u306e\u5024\u3068\u3057\u3066\u51e6\u7406\u3059\u308b<\/li>\n\n\n\n<li><strong>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u691c\u8a3c\u3068\u51e6\u7406<\/strong>: \u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u5206\u89e3\u3068\u691c\u8a3c<\/li>\n\n\n\n<li><strong>URL\u89e3\u6790<\/strong>: \u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3084\u30d1\u30b9\u60c5\u5831\u306e\u62bd\u51fa<\/li>\n\n\n\n<li><strong>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f<\/strong>: \u8a2d\u5b9a\u5024\u306e\u89e3\u6790\u3068\u9069\u7528<\/li>\n\n\n\n<li><strong>\u30c6\u30ad\u30b9\u30c8\u51e6\u7406<\/strong>: \u6587\u7ae0\u306e\u5358\u8a9e\u5206\u5272\u3084\u7279\u5b9a\u30d1\u30bf\u30fc\u30f3\u306e\u62bd\u51fa<\/li>\n\n\n\n<li><strong>API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406<\/strong>: JSON\/XML\u30c7\u30fc\u30bf\u304b\u3089\u306e\u5fc5\u8981\u60c5\u5831\u306e\u62bd\u51fa<\/li>\n<\/ul>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u3067\u3088\u304f\u4f7f\u308f\u308c\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=\"\">\/\/ URL\u304b\u3089\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u4f8b\n$url = \"https:\/\/example.com\/search?keyword=php&amp;category=programming\";\n$queryString = explode('?', $url)[1]; \/\/ \"keyword=php&amp;category=programming\"\n$params = explode('&amp;', $queryString); \/\/ [\"keyword=php\", \"category=programming\"]\n\n\/\/ CSV\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u4f8b\n$csvLine = \"John,Doe,john@example.com,123-456-7890\";\n$userData = explode(',', $csvLine); \/\/ [\"John\", \"Doe\", \"john@example.com\", \"123-456-7890\"]\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u304c\u3001\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u571f\u53f0\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u306e\u7279\u5fb4\u3092\u7406\u89e3\u3057\u3088\u3046<\/h3>\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u306b\u306f\u3001\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u6bd4\u8f03\u3057\u3066\u3044\u304f\u3064\u304b\u306e\u7279\u5fb4\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30d0\u30a4\u30ca\u30ea\u30bb\u30fc\u30d5<\/strong>: PHP\u306e\u6587\u5b57\u5217\u306f\u4efb\u610f\u306e\u30d0\u30a4\u30c8\u5024\uff080x00-0xFF\uff09\u3092\u542b\u3080\u3053\u3068\u304c\u3067\u304d\u3001\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u306e\u51e6\u7406\u306b\u3082\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5909\u66f4\u53ef\u80fd\uff08Mutable\uff09<\/strong>: Java\u3084Python\u306a\u3069\u306e\u8a00\u8a9e\u3068\u7570\u306a\u308a\u3001PHP\u306e\u6587\u5b57\u5217\u306f\u5909\u66f4\u53ef\u80fd\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u826f\u3044\u64cd\u4f5c\u304c\u53ef\u80fd\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u975e\u4f9d\u5b58<\/strong>: PHP\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u7279\u5b9a\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u5f37\u5236\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u67d4\u8edf\u6027\u3092\u3082\u305f\u3089\u3059\u4e00\u65b9\u3067\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3092\u6271\u3046\u969b\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3068\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u306e\u9055\u3044<\/strong>: PHP\u3067\u306f\u3001\u6587\u5b57\u5217\u306e\u8868\u8a18\u65b9\u6cd5\u306b\u3088\u3063\u3066\u6319\u52d5\u304c\u5909\u308f\u308a\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=\"\">$name = \"World\";\necho \"Hello $name\"; \/\/ \"Hello World\" - \u5909\u6570\u304c\u5c55\u958b\u3055\u308c\u308b\necho 'Hello $name'; \/\/ \"Hello $name\" - \u305d\u306e\u307e\u307e\u51fa\u529b\u3055\u308c\u308b<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8c4a\u5bcc\u306a\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570<\/strong>: PHP\u306b\u306f100\u4ee5\u4e0a\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570\u304c\u7d44\u307f\u8fbc\u307e\u308c\u3066\u304a\u308a\u3001\u6587\u5b57\u5217\u5206\u5272\u306b\u3064\u3044\u3066\u3082\u69d8\u3005\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u53ef\u80fd\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6587\u5b57\u5217\u5206\u5272\u306e\u4e3b\u8981\u306a\u95a2\u6570\u3068\u3057\u3066\u306f\u3001<code>explode()<\/code>\u3001<code>str_split()<\/code>\u3001<code>preg_split()<\/code>\u3001<code>strtok()<\/code>\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u7528\u306e<code>mb_split()<\/code>\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u3001\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u72b6\u6cc1\u3084\u8981\u4ef6\u306b\u6700\u9069\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u9069\u5207\u306b\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3068\u52b9\u7387\u6027\u3092\u9ad8\u3081\u308b\u3053\u3068\u304c\u3067\u304d\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\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u306e\u8a73\u7d30\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\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\u5206\u5272\u95a2\u6570\u3068\u305d\u306e\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p>PHP\u306b\u306f\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u305f\u3081\u306e3\u3064\u306e\u57fa\u672c\u7684\u306a\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u5206\u5272\u65b9\u6cd5\u3092\u6301\u3061\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u306e\u8a73\u7d30\u306a\u4f7f\u3044\u65b9\u3068\u9069\u5207\u306a\u4f7f\u7528\u30b7\u30fc\u30f3\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">explode()\u95a2\u6570\u3067\u30c7\u30ea\u30df\u30bf\u3092\u4f7f\u3063\u305f\u7c21\u5358\u5206\u5272<\/h3>\n\n\n\n<p><code>explode()<\/code>\u306f\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u4f7f\u3044\u3084\u3059\u3044\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u3067\u3059\u3002\u7279\u5b9a\u306e\u533a\u5207\u308a\u6587\u5b57\uff08\u30c7\u30ea\u30df\u30bf\uff09\u3067\u6587\u5b57\u5217\u3092\u5206\u5272\u3057\u3001\u7d50\u679c\u3092\u914d\u5217\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\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=\"\">array explode(string $separator, string $string, int $limit = PHP_INT_MAX)\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$separator<\/code>: \u533a\u5207\u308a\u6587\u5b57\uff08\u30c7\u30ea\u30df\u30bf\uff09\u3068\u306a\u308b\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$string<\/code>: \u5206\u5272\u3059\u308b\u5143\u306e\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$limit<\/code>: \u8fd4\u3055\u308c\u308b\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09<\/li>\n<\/ul>\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=\"\">\/\/ \u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\n$fruits = \"apple,banana,orange,grape\";\n$fruitArray = explode(',', $fruits);\nprint_r($fruitArray);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; apple [1] =&gt; banana [2] =&gt; orange [3] =&gt; grape )\n\n\/\/ limit\u5f15\u6570\u3092\u4f7f\u7528\u3057\u305f\u4f8b\n$data = \"name|email|phone|address\";\n$fields = explode('|', $data, 3);\nprint_r($fields);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; name [1] =&gt; email [2] =&gt; phone|address )\n\n\/\/ \u8ca0\u306elimit\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u672b\u5c3e\u304b\u3089\u305d\u306e\u6570\u306e\u8981\u7d20\u3092\u9664\u5916\n$text = \"a:b:c:d:e\";\n$parts = explode(':', $text, -2);\nprint_r($parts);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; a [1] =&gt; b [2] =&gt; c )\n<\/pre>\n\n\n\n<p><strong>\u6ce8\u610f\u70b9<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP 8.0\u672a\u6e80\u3067\u306f\u3001\u7a7a\u306e\u533a\u5207\u308a\u6587\u5b57\u3092\u4f7f\u3046\u3068Warning\u304c\u767a\u751f\u3057\u3001false\u304c\u8fd4\u3055\u308c\u307e\u3059<\/li>\n\n\n\n<li>PHP 8.0\u4ee5\u964d\u3067\u306f\u3001\u7a7a\u306e\u533a\u5207\u308a\u6587\u5b57\u3092\u4f7f\u3046\u3068ValueError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059<\/li>\n\n\n\n<li>\u533a\u5207\u308a\u6587\u5b57\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u3001\u5143\u306e\u6587\u5b57\u5217\u3092\u542b\u30801\u8981\u7d20\u306e\u914d\u5217\u304c\u8fd4\u3055\u308c\u307e\u3059<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">str_split()\u95a2\u6570\u3067\u7b49\u9593\u9694\u306b\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p><code>str_split()<\/code>\u306f\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u305f\u9577\u3055\u3054\u3068\u306b\u5206\u5272\u3059\u308b\u95a2\u6570\u3067\u3059\u3002\u6587\u5b57\u5217\u3092\u7b49\u9593\u9694\u3067\u51e6\u7406\u3057\u305f\u3044\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\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=\"\">array str_split(string $string, int $length = 1)\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$string<\/code>: \u5206\u5272\u3059\u308b\u5143\u306e\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$length<\/code>: \u5404\u5206\u5272\u90e8\u5206\u306e\u9577\u3055\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f1\uff09<\/li>\n<\/ul>\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=\"\">\/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u9577\u30551\u3067\u5206\u5272\uff081\u6587\u5b57\u305a\u3064\uff09\n$text = \"Hello\";\n$chars = str_split($text);\nprint_r($chars);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; H [1] =&gt; e [2] =&gt; l [3] =&gt; l [4] =&gt; o )\n\n\/\/ \u6307\u5b9a\u3057\u305f\u9577\u3055\u3067\u5206\u5272\n$data = \"ABCDEFGHIJK\";\n$chunks = str_split($data, 3);\nprint_r($chunks);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; ABC [1] =&gt; DEF [2] =&gt; GHI [3] =&gt; JK )\n\n\/\/ \u56fa\u5b9a\u9577\u30c7\u30fc\u30bf\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u51e6\u7406\n$hexData = \"FF00A3C4D2\";\n$bytes = str_split($hexData, 2);\nprint_r($bytes);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; FF [1] =&gt; 00 [2] =&gt; A3 [3] =&gt; C4 [4] =&gt; D2 )\n<\/pre>\n\n\n\n<p><strong>\u91cd\u8981\u306a\u6ce8\u610f\u70b9<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>str_split()<\/code>\u306f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3092\u6b63\u3057\u304f\u51e6\u7406\u3067\u304d\u307e\u305b\u3093<\/li>\n\n\n\n<li>PHP 7.4\u4ee5\u964d\u3067\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e<code>mb_str_split()<\/code>\u95a2\u6570\u304c\u5229\u7528\u3067\u304d\u307e\u3059<\/li>\n\n\n\n<li>PHP 8.0\u672a\u6e80\u3067\u9577\u3055\u304c1\u672a\u6e80\u306e\u5834\u5408\u306fWarning\u304c\u767a\u751f\u3057\u3001PHP 8.0\u4ee5\u964d\u3067\u306fValueError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">preg_split()\u95a2\u6570\u3067\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u5206\u5272<\/h3>\n\n\n\n<p><code>preg_split()<\/code>\u306f\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u5f37\u529b\u306a\u95a2\u6570\u3067\u3059\u3002\u8907\u96d1\u306a\u5206\u5272\u6761\u4ef6\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\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=\"\">array preg_split(string $pattern, string $subject, int $limit = -1, int $flags = 0)\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$pattern<\/code>: \u533a\u5207\u308a\u3068\u306a\u308b\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/li>\n\n\n\n<li><code>$subject<\/code>: \u5206\u5272\u3059\u308b\u5143\u306e\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$limit<\/code>: \u8fd4\u3055\u308c\u308b\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u7121\u5236\u9650\uff09<\/li>\n\n\n\n<li><code>$flags<\/code>: \u8ffd\u52a0\u306e\u30d5\u30e9\u30b0\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e3b\u8981\u306a\u30d5\u30e9\u30b0<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>PREG_SPLIT_NO_EMPTY<\/code>: \u7a7a\u306e\u8981\u7d20\u3092\u7d50\u679c\u306b\u542b\u3081\u306a\u3044<\/li>\n\n\n\n<li><code>PREG_SPLIT_DELIM_CAPTURE<\/code>: \u6b63\u898f\u8868\u73fe\u5185\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3082\u7d50\u679c\u306b\u542b\u3081\u308b<\/li>\n\n\n\n<li><code>PREG_SPLIT_OFFSET_CAPTURE<\/code>: \u5404\u8981\u7d20\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\uff08\u4f4d\u7f6e\uff09\u60c5\u5831\u3082\u8fd4\u3059<\/li>\n<\/ul>\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=\"\">\/\/ \u8907\u6570\u306e\u7a7a\u767d\u6587\u5b57\u3067\u5206\u5272\n$text = \"Hello   World\\tPHP\\nProgramming\";\n$words = preg_split('\/\\s+\/', $text);\nprint_r($words);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; Hello [1] =&gt; World [2] =&gt; PHP [3] =&gt; Programming )\n\n\/\/ \u8907\u6570\u306e\u533a\u5207\u308a\u6587\u5b57\u3067\u5206\u5272\uff08\u30ab\u30f3\u30de\u307e\u305f\u306f\u30bb\u30df\u30b3\u30ed\u30f3\uff09\n$data = \"apple,banana;orange,grape;melon\";\n$fruits = preg_split('\/[,;]\/', $data);\nprint_r($fruits);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; apple [1] =&gt; banana [2] =&gt; orange [3] =&gt; grape [4] =&gt; melon )\n\n\/\/ \u533a\u5207\u308a\u6587\u5b57\u3082\u7d50\u679c\u306b\u542b\u3081\u308b\n$str = \"a,b.c\";\n$parts = preg_split('\/(,|\\.)\/', $str, -1, PREG_SPLIT_DELIM_CAPTURE);\nprint_r($parts);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; a [1] =&gt; , [2] =&gt; b [3] =&gt; . [4] =&gt; c )\n<\/pre>\n\n\n\n<p><strong>\u5fdc\u7528\u4f8b<\/strong>: \u6570\u5b57\u3068\u6587\u5b57\u3092\u5206\u96e2<\/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=\"\">$mixed = \"abc123def456ghi\";\n$parts = preg_split('\/(\\d+)\/', $mixed, -1, PREG_SPLIT_DELIM_CAPTURE);\nprint_r($parts);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; abc [1] =&gt; 123 [2] =&gt; def [3] =&gt; 456 [4] =&gt; ghi )\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">\u4f7f\u3044\u5206\u3051\u306e\u76ee\u5b89<\/h3>\n\n\n\n<p>\u5404\u95a2\u6570\u306e\u7279\u5fb4\u3068\u6700\u9069\u306a\u4f7f\u7528\u30b7\u30fc\u30f3\u3092\u4ee5\u4e0b\u306e\u8868\u306b\u307e\u3068\u3081\u307e\u3059\uff1a<\/p>\n\n\n<div id=\"id-2b363ddb-f634-44a2-8ad7-8cbb86a69f19\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u95a2\u6570<\/th><th>\u7279\u5fb4<\/th><th>\u9577\u6240<\/th><th>\u77ed\u6240<\/th><th>\u6700\u9069\u306a\u4f7f\u7528\u30b1\u30fc\u30b9<\/th><\/tr><\/thead><tbody><tr><td><code>explode()<\/code><\/td><td>\u5358\u4e00\u306e\u533a\u5207\u308a\u6587\u5b57\u3067\u5206\u5272<\/td><td>\u30b7\u30f3\u30d7\u30eb\u3067\u4f7f\u3044\u3084\u3059\u3044\u3001\u9ad8\u901f<\/td><td>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u975e\u5bfe\u5fdc<\/td><td>\u5358\u7d14\u306a\u533a\u5207\u308a\u6587\u5b57\u306b\u3088\u308b\u5206\u5272\uff08CSV\u3001\u7c21\u5358\u306a\u30c7\u30fc\u30bf\u5f62\u5f0f\uff09<\/td><\/tr><tr><td><code>str_split()<\/code><\/td><td>\u56fa\u5b9a\u9577\u3067\u5206\u5272<\/td><td>\u7b49\u9593\u9694\u5206\u5272\u304c\u7c21\u5358<\/td><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u975e\u5bfe\u5fdc<\/td><td>\u56fa\u5b9a\u9577\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3001\u6587\u5b57\u3054\u3068\u306e\u51e6\u7406<\/td><\/tr><tr><td><code>preg_split()<\/code><\/td><td>\u6b63\u898f\u8868\u73fe\u306b\u3088\u308b\u30d1\u30bf\u30fc\u30f3\u5206\u5272<\/td><td>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u5bfe\u5fdc\u3001\u67d4\u8edf\u6027\u304c\u9ad8\u3044<\/td><td>\u5b66\u7fd2\u30b3\u30b9\u30c8\u9ad8\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3084\u3084\u4f4e\u3044<\/td><td>\u8907\u96d1\u306a\u30c6\u30ad\u30b9\u30c8\u89e3\u6790\u3001\u8907\u6570\u6761\u4ef6\u3067\u306e\u5206\u5272<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u51e6\u7406\u3067\u306f\u30b7\u30f3\u30d7\u30eb\u306a<code>explode()<\/code>\u304b\u3089\u59cb\u3081\u3001\u3088\u308a\u8907\u96d1\u306a\u8981\u4ef6\u304c\u3042\u308b\u5834\u5408\u306b<code>preg_split()<\/code>\u3092\u691c\u8a0e\u3059\u308b\u306e\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u56fa\u5b9a\u9577\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u306f<code>str_split()<\/code>\u304c\u6700\u9069\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-8\">\u65e5\u672c\u8a9e\uff08\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff09\u306e\u6587\u5b57\u5217\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<p>PHP\u3067\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u5834\u5408\u3001\u901a\u5e38\u306e\u6587\u5b57\u5217\u95a2\u6570\u3067\u306f\u9069\u5207\u306b\u51e6\u7406\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3068\u306f\u30011\u6587\u5b57\u306e\u8868\u73fe\u306b\u8907\u6570\u306e\u30d0\u30a4\u30c8\u3092\u5fc5\u8981\u3068\u3059\u308b\u6587\u5b57\u4f53\u7cfb\u306e\u3053\u3068\u3067\u3001\u65e5\u672c\u8a9e\u3001\u4e2d\u56fd\u8a9e\u3001\u97d3\u56fd\u8a9e\u3001\u7d75\u6587\u5b57\u306a\u3069\u304c\u8a72\u5f53\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6b63\u3057\u304f\u5206\u5272\u3059\u308b\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">mb_split()\u95a2\u6570\u3092\u4f7f\u3063\u305f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u5206\u5272\u65b9\u6cd5<\/h3>\n\n\n\n<p><code>mb_split()<\/code>\u95a2\u6570\u306f\u3001<code>preg_split()<\/code>\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u7248\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u969b\u306b\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6b63\u3057\u304f\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\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=\"\">array mb_split(string $pattern, string $string, int $limit = -1)\n<\/pre>\n\n\n\n<p><strong>\u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>$pattern<\/code>: \u533a\u5207\u308a\u3068\u306a\u308b\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3<\/li>\n\n\n\n<li><code>$string<\/code>: \u5206\u5272\u3059\u308b\u5143\u306e\u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>$limit<\/code>: \u8fd4\u3055\u308c\u308b\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u7121\u5236\u9650\uff09<\/li>\n<\/ul>\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=\"\">\/\/ \u65e5\u672c\u8a9e\u306e\u53e5\u8aad\u70b9\u3067\u5206\u5272\n$text = \"\u308a\u3093\u3054\u3001\u30d0\u30ca\u30ca\u3001\u307f\u304b\u3093\u3001\u3076\u3069\u3046\";\n$fruits = mb_split('\u3001', $text);\nprint_r($fruits);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u308a\u3093\u3054 [1] =&gt; \u30d0\u30ca\u30ca [2] =&gt; \u307f\u304b\u3093 [3] =&gt; \u3076\u3069\u3046 )\n\n\/\/ \u5168\u89d2\u30fb\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3067\u5206\u5272\n$sentence = \"PHP\u3000\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 \u5165\u9580 \u8b1b\u5ea7\";  \/\/ \u6ce8: \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3068\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u304c\u6df7\u5728\n$words = mb_split('[[:space:]]+', $sentence);\nprint_r($words);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; PHP [1] =&gt; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 [2] =&gt; \u5165\u9580 [3] =&gt; \u8b1b\u5ea7 )\n\n\/\/ \u7279\u5b9a\u306e\u6587\u5b57\u3067\u5206\u5272\n$text = \"\u6c34\u66dc\u65e5\u3068\u91d1\u66dc\u65e5\u306b\u4f1a\u8b70\u304c\u3042\u308a\u307e\u3059\";\n$parts = mb_split('\u66dc\u65e5', $text);\nprint_r($parts);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u6c34 [1] =&gt; \u3068\u91d1 [2] =&gt; \u306b\u4f1a\u8b70\u304c\u3042\u308a\u307e\u3059 )\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>mb_split()<\/code>\u306f<code>preg_split()<\/code>\u3068\u306f\u7570\u306a\u308a\u3001\u30d5\u30e9\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf\uff08<code>PREG_SPLIT_NO_EMPTY<\/code>\u306a\u3069\uff09\u304c\u3042\u308a\u307e\u305b\u3093<\/li>\n\n\n\n<li>\u4f7f\u7528\u524d\u306b<code>mb_regex_encoding()<\/code>\u3067\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3068\u5b89\u5168\u3067\u3059<\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u51e6\u7406\u306b\u306f<code>mb_ereg()<\/code>\u95a2\u6570\u3068\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u6709\u52b9\u3067\u3059<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">\u6587\u5b57\u5316\u3051\u3092\u9632\u3050\u305f\u3081\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\u306e\u91cd\u8981\u6027<\/h3>\n\n\n\n<p>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u969b\u3001\u9069\u5207\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\u304c\u6587\u5b57\u5316\u3051\u3092\u9632\u3050\u9375\u3068\u306a\u308a\u307e\u3059\u3002PHP\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u57fa\u672c\u7684\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/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=\"\">\/\/ \u5185\u90e8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\uff08\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u3067\u4f7f\u7528\u3055\u308c\u308b\u6587\u5b57\u30b3\u30fc\u30c9\uff09\nmb_internal_encoding('UTF-8');\n\n\/\/ HTTP\u51fa\u529b\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\uff08\u30d6\u30e9\u30a6\u30b6\u3078\u306e\u51fa\u529b\uff09\nmb_http_output('UTF-8');\n\n\/\/ \u8a00\u8a9e\u306e\u8a2d\u5b9a\nmb_language('Japanese');\n\n\/\/ \u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u691c\u51fa\u9806\u5e8f\u306e\u8a2d\u5b9a\nmb_detect_order('UTF-8, SJIS, EUC-JP, ASCII');\n<\/pre>\n\n\n\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u305f\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u7279\u306b\u4ee5\u4e0b\u306e\u70b9\u306b\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u6642\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a<\/strong>: <\/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=\"\">$pdo = new PDO('mysql:host=localhost;dbname=test;charset=utf8mb4');\n\/\/ \u307e\u305f\u306f\nmysqli_set_charset($connection, 'utf8mb4');<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u6642\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8003\u616e<\/strong>:<\/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=\"\">\/\/ \u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u6642\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u5909\u63db\n$content = file_get_contents('japanese_text.txt');\n$utf8_content = mb_convert_encoding($content, 'UTF-8', 'SJIS');\n\n\/\/ \u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u8fbc\u307f\u6642\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u6307\u5b9a\nfile_put_contents('output.txt', mb_convert_encoding($text, 'SJIS', 'UTF-8'));<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>HTML\u3067\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u6307\u5b9a<\/strong>: <\/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=\"\">&lt;meta charset=\"UTF-8\"&gt;<\/pre>\n\n\n\n<p>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u4e0d\u4e00\u81f4\u306f\u69d8\u3005\u306a\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001UTF-8\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092SJIS\u3068\u3057\u3066\u51e6\u7406\u3059\u308b\u3068\u6587\u5b57\u5316\u3051\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u7279\u306b\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3001\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306e\u9593\u3067\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272\u3059\u308b\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<p>\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272\u3059\u308b\u65b9\u6cd5\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002PHP 7.4\u4ee5\u964d\u3068\u3001\u305d\u308c\u3088\u308a\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u6700\u9069\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>PHP 7.4\u4ee5\u964d\u3067\u306e\u63a8\u5968\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<p>PHP 7.4\u3067\u5c0e\u5165\u3055\u308c\u305f<code>mb_str_split()<\/code>\u95a2\u6570\u3092\u4f7f\u3046\u306e\u304c\u6700\u3082\u7c21\u5358\u3067\u52b9\u7387\u7684\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=\"\">\/\/ mb_str_split() - PHP 7.4\u4ee5\u964d\n$text = \"\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\";\n$chars = mb_str_split($text);\nprint_r($chars);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u3053 [1] =&gt; \u3093 [2] =&gt; \u306b [3] =&gt; \u3061 [4] =&gt; \u306f [5] =&gt; \u4e16 [6] =&gt; \u754c )\n\n\/\/ 2\u6587\u5b57\u305a\u3064\u5206\u5272\u3059\u308b\u4f8b\n$text = \"PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\";\n$chunks = mb_str_split($text, 2);\nprint_r($chunks);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; PH [1] =&gt; P\u30d7 [2] =&gt; \u30ed [3] =&gt; \u30b0 [4] =&gt; \u30e9 [5] =&gt; \u30df [6] =&gt; \u30f3 [7] =&gt; \u30b0 )\n<\/pre>\n\n\n\n<p><strong>PHP 7.4\u672a\u6e80\u3067\u306e\u65b9\u6cd5<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\uff08UTF-8\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff09<\/strong>: <\/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 = \"\u3053\u3093\u306b\u3061\u306f\";\n$chars = preg_split('\/\/u', $text, -1, PREG_SPLIT_NO_EMPTY);\nprint_r($chars);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u3053 [1] =&gt; \u3093 [2] =&gt; \u306b [3] =&gt; \u3061 [4] =&gt; \u306f )<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>mb_substr()\u3068\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5<\/strong>:<\/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 = \"\u3053\u3093\u306b\u3061\u306f\";\n$chars = [];\nfor ($i = 0; $i &lt; mb_strlen($text); $i++) {\n    $chars[] = mb_substr($text, $i, 1);\n}\nprint_r($chars);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u3053 [1] =&gt; \u3093 [2] =&gt; \u306b [3] =&gt; \u3061 [4] =&gt; \u306f )<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u72ec\u81ea\u306e\u30dd\u30ea\u30d5\u30a3\u30eb\u95a2\u6570\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5<\/strong>: <\/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 mb_str_split_polyfill($string, $length = 1, $encoding = null) {\n    if ($encoding === null) {\n        $encoding = mb_internal_encoding();\n    }\n    $result = [];\n    $strlen = mb_strlen($string, $encoding);\n    for ($i = 0; $i &lt; $strlen; $i += $length) {\n        $result[] = mb_substr($string, $i, $length, $encoding);\n    }\n    return $result;\n}\n\n$text = \"\u3053\u3093\u306b\u3061\u306f\";\n$chars = mb_str_split_polyfill($text);\nprint_r($chars);\n\/\/ \u51fa\u529b: Array ( [0] =&gt; \u3053 [1] =&gt; \u3093 [2] =&gt; \u306b [3] =&gt; \u3061 [4] =&gt; \u306f )<\/pre>\n\n\n\n<p>\u3044\u305a\u308c\u306e\u65b9\u6cd5\u3082\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u5217\u3092\u6b63\u3057\u304f1\u6587\u5b57\u305a\u3064\u5206\u5272\u3067\u304d\u307e\u3059\u304c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30b3\u30fc\u30c9\u306e\u7c21\u6f54\u3055\u3092\u8003\u616e\u3059\u308b\u3068\u3001PHP 7.4\u4ee5\u964d\u3067\u306f<code>mb_str_split()<\/code>\u3092\u4f7f\u7528\u3059\u308b\u306e\u304c\u6700\u3082\u63a8\u5968\u3055\u308c\u307e\u3059\u3002\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePHP\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u51e6\u7406\u3059\u308b\u6587\u5b57\u5217\u306e\u30b5\u30a4\u30ba\u3084\u983b\u5ea6\u306b\u5fdc\u3058\u3066\u6700\u9069\u306a\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u6587\u5b57\u5217\u64cd\u4f5c\u306f\u983b\u7e41\u306b\u884c\u308f\u308c\u308b\u51e6\u7406\u306e\u305f\u3081\u3001\u6b63\u3057\u3044\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\u3068\u9069\u5207\u306a\u95a2\u6570\u306e\u9078\u629e\u304c\u3001\u5b89\u5b9a\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u57fa\u76e4\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-12\">\u5b9f\u8df5\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af5\u9078<\/h2>\n\n\n\n<p>\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u306e\u65b9\u6cd5\u3092\u7406\u89e3\u3057\u305f\u3068\u3053\u308d\u3067\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3088\u304f\u5fc5\u8981\u3068\u306a\u308b\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306f\u3001\u65e5\u5e38\u306e\u958b\u767a\u4f5c\u696d\u3067\u983b\u7e41\u306b\u906d\u9047\u3059\u308b5\u3064\u306e\u30b7\u30ca\u30ea\u30aa\u3068\u3001\u305d\u308c\u305e\u308c\u306e\u52b9\u7387\u7684\u306a\u89e3\u6c7a\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">CSV\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u4f8b<\/h3>\n\n\n\n<p>CSV\u30d5\u30a1\u30a4\u30eb\u306e\u51e6\u7406\u306fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u3088\u304f\u906d\u9047\u3059\u308b\u30bf\u30b9\u30af\u3067\u3059\u3002\u5358\u7d14\u306a\u5834\u5408\u306f<code>explode()<\/code>\u3067\u5341\u5206\u3067\u3059\u304c\u3001\u3088\u308a\u5805\u7262\u306a\u51e6\u7406\u306b\u306fPHP\u306e\u5c02\u7528\u95a2\u6570\u3092\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-14\">\u57fa\u672c\u7684\u306aCSV\u884c\u306e\u89e3\u6790<\/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=\"\">\/\/ \u5358\u7d14\u306aapproach\uff08\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u307f\uff09\nfunction parse_csv_simple($line) {\n    return explode(',', $line);\n}\n\n\/\/ \u3088\u308a\u5805\u7262\u306aapproach\uff08\u5f15\u7528\u7b26\u3067\u56f2\u307e\u308c\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u3082\u6b63\u3057\u304f\u51e6\u7406\uff09\nfunction parse_csv_robust($line) {\n    return str_getcsv($line);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$csv_line = '\"John Doe\",\"john@example.com\",\"123,456,789\"';\n$data_simple = parse_csv_simple($csv_line); \/\/ \u554f\u984c\u3042\u308a: \"John Doe\",\"john@example.com\",\"123\u3092\u5225\u3005\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3057\u3066\u6271\u3063\u3066\u3057\u307e\u3046\n$data_robust = parse_csv_robust($csv_line); \/\/ \u6b63\u3057\u3044\u7d50\u679c: [\"John Doe\", \"john@example.com\", \"123,456,789\"]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-15\">\u30d8\u30c3\u30c0\u30fc\u4ed8\u304dCSV\u30d5\u30a1\u30a4\u30eb\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30d8\u30c3\u30c0\u30fc\u884c\u3092\u6301\u3064CSV\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u591a\u3044\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=\"\">function parse_csv_with_headers($filename) {\n    $rows = [];\n    if (($handle = fopen($filename, 'r')) !== false) {\n        \/\/ \u6700\u521d\u306e\u884c\u3092\u30d8\u30c3\u30c0\u30fc\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3080\n        $headers = fgetcsv($handle);\n        \n        \/\/ \u6b8b\u308a\u306e\u884c\u3092\u30c7\u30fc\u30bf\u3068\u3057\u3066\u51e6\u7406\n        while (($data = fgetcsv($handle)) !== false) {\n            $row = [];\n            \/\/ \u30d8\u30c3\u30c0\u30fc\u3068\u5024\u3092\u95a2\u9023\u4ed8\u3051\u308b\n            foreach ($headers as $i =&gt; $header) {\n                $row[$header] = $data[$i] ?? null;\n            }\n            $rows[] = $row;\n        }\n        fclose($handle);\n    }\n    return $rows;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$users = parse_csv_with_headers('users.csv');\nforeach ($users as $user) {\n    echo \"Name: {$user['name']}, Email: {$user['email']}\\n\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-16\">\u65e5\u672c\u8a9eCSV\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u542b\u3080CSV\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u3001\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\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=\"\">function parse_japanese_csv($filename, $encoding = 'SJIS') {\n    $rows = [];\n    if (($handle = fopen($filename, 'r')) !== false) {\n        $headers = fgetcsv($handle);\n        \/\/ \u30d8\u30c3\u30c0\u30fc\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u5909\u63db\n        $headers = array_map(function($header) use ($encoding) {\n            return mb_convert_encoding($header, 'UTF-8', $encoding);\n        }, $headers);\n        \n        while (($data = fgetcsv($handle)) !== false) {\n            \/\/ \u30c7\u30fc\u30bf\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u5909\u63db\n            $data = array_map(function($field) use ($encoding) {\n                return mb_convert_encoding($field, 'UTF-8', $encoding);\n            }, $data);\n            \n            $row = [];\n            foreach ($headers as $i =&gt; $header) {\n                $row[$header] = $data[$i] ?? null;\n            }\n            $rows[] = $row;\n        }\n        fclose($handle);\n    }\n    return $rows;\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">URL\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u62bd\u51fa\u3068\u5206\u89e3\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001URL\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u62bd\u51fa\u3057\u3066\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002PHP\u306b\u306f\u4fbf\u5229\u306a\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-18\">\u57fa\u672c\u7684\u306aURL\u30d1\u30e9\u30e1\u30fc\u30bf\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=\"\">function extract_url_params($url) {\n    \/\/ parse_url()\u3067URL\u3092\u69cb\u6210\u8981\u7d20\u306b\u5206\u89e3\n    $parts = parse_url($url);\n    $params = [];\n    \n    \/\/ \u30af\u30a8\u30ea\u6587\u5b57\u5217\u304c\u3042\u308b\u5834\u5408\u306e\u307f\u51e6\u7406\n    if (isset($parts['query'])) {\n        \/\/ parse_str()\u3067\u30af\u30a8\u30ea\u6587\u5b57\u5217\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u9023\u60f3\u914d\u5217\u306b\u5909\u63db\n        parse_str($parts['query'], $params);\n    }\n    \n    return $params;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$url = 'https:\/\/example.com\/search?keyword=php&amp;category=programming&amp;page=2';\n$params = extract_url_params($url);\n\/*\n\u7d50\u679c:\n[\n    'keyword' =&gt; 'php',\n    'category' =&gt; 'programming',\n    'page' =&gt; '2'\n]\n*\/\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-19\">\u968e\u5c64\u7684\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>REST API\u3084\u30e2\u30c0\u30f3\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001<code>filter[name]=test&amp;filter[age]=20<\/code>\u306e\u3088\u3046\u306a\u968e\u5c64\u7684\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u3088\u304f\u4f7f\u7528\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=\"\">function parse_nested_params($url) {\n    $query = parse_url($url, PHP_URL_QUERY);\n    if (!$query) return [];\n    \n    $result = [];\n    parse_str($query, $params);\n    \n    \/\/ parse_str()\u306f\u81ea\u52d5\u7684\u306b\u914d\u5217\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u3001\n    \/\/ \u7d50\u679c\u3092\u305d\u306e\u307e\u307e\u8fd4\u3059\u3060\u3051\u3067\u826f\u3044\n    return $params;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$url = 'https:\/\/api.example.com\/users?filter[status]=active&amp;filter[role]=admin&amp;sort[field]=created_at&amp;sort[direction]=desc';\n$params = parse_nested_params($url);\n\/*\n\u7d50\u679c:\n[\n    'filter' =&gt; [\n        'status' =&gt; 'active',\n        'role' =&gt; 'admin'\n    ],\n    'sort' =&gt; [\n        'field' =&gt; 'created_at',\n        'direction' =&gt; 'desc'\n    ]\n]\n*\/\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-20\">\u30eb\u30fc\u30c8\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u62bd\u51fa<\/h4>\n\n\n\n<p>\u30e2\u30c0\u30f3\u306aWeb\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u3088\u3046\u306b\u30eb\u30fc\u30c8\u304b\u3089\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3082\u7d39\u4ecb\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=\"\">function extract_route_params($pattern, $url) {\n    \/\/ \u30d1\u30bf\u30fc\u30f3\u4f8b: '\/users\/{id}\/profile\/{section}'\n    \/\/ URL\u4f8b: '\/users\/123\/profile\/personal'\n    \n    $pattern_parts = explode('\/', trim($pattern, '\/'));\n    $url_parts = explode('\/', trim($url, '\/'));\n    \n    if (count($pattern_parts) !== count($url_parts)) {\n        return null; \/\/ \u30d1\u30bf\u30fc\u30f3\u3068URL\u306e\u69cb\u9020\u304c\u4e00\u81f4\u3057\u306a\u3044\n    }\n    \n    $params = [];\n    for ($i = 0; $i &lt; count($pattern_parts); $i++) {\n        $pattern_part = $pattern_parts[$i];\n        if (preg_match('\/^\\{([a-zA-Z0-9_]+)\\}$\/', $pattern_part, $matches)) {\n            $param_name = $matches[1];\n            $params[$param_name] = $url_parts[$i];\n        } elseif ($pattern_part !== $url_parts[$i]) {\n            return null; \/\/ \u56fa\u5b9a\u90e8\u5206\u304c\u4e00\u81f4\u3057\u306a\u3044\n        }\n    }\n    \n    return $params;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$pattern = '\/users\/{id}\/profile\/{section}';\n$url = '\/users\/123\/profile\/personal';\n$params = extract_route_params($pattern, $url);\n\/\/ \u7d50\u679c: ['id' =&gt; '123', 'section' =&gt; 'personal']\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-21\">\u8907\u6570\u306e\u30c7\u30ea\u30df\u30bf\u3092\u4f7f\u3063\u305f\u8907\u96d1\u306a\u6587\u5b57\u5217\u306e\u5206\u5272\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u8907\u6570\u306e\u533a\u5207\u308a\u6587\u5b57\u3067\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-22\">\u57fa\u672c\u7684\u306a\u8907\u6570\u30c7\u30ea\u30df\u30bf\u5206\u5272<\/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=\"\">function split_by_multiple_delimiters($string, $delimiters) {\n    \/\/ \u533a\u5207\u308a\u6587\u5b57\u3092\u6b63\u898f\u8868\u73fe\u306e\u6587\u5b57\u30af\u30e9\u30b9\u306b\u307e\u3068\u3081\u308b\n    $pattern = '\/[' . preg_quote(implode('', $delimiters), '\/') . ']\/'; \n    return preg_split($pattern, $string);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"apple,banana;orange\\tcherry\";\n$result = split_by_multiple_delimiters($text, [',', ';', \"\\t\"]);\n\/\/ \u7d50\u679c: ['apple', 'banana', 'orange', 'cherry']\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-23\">\u968e\u5c64\u7684\u306a\u5206\u5272\u51e6\u7406<\/h4>\n\n\n\n<p>\u8907\u6570\u306e\u30c7\u30ea\u30df\u30bf\u3092\u512a\u5148\u9806\u4f4d\u4ed8\u304d\u3067\u9069\u7528\u3057\u3001\u968e\u5c64\u69cb\u9020\u3092\u4f5c\u6210\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\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=\"\">function hierarchical_split($string, $delimiters) {\n    if (empty($delimiters)) {\n        return [$string];\n    }\n    \n    \/\/ \u6700\u521d\u306e\u30c7\u30ea\u30df\u30bf\u3092\u53d6\u308a\u51fa\u3057\u3066\u5206\u5272\n    $delimiter = array_shift($delimiters);\n    $parts = explode($delimiter, $string);\n    \n    \/\/ \u30c7\u30ea\u30df\u30bf\u304c\u306a\u304f\u306a\u3063\u305f\u3089\u7d42\u4e86\n    if (empty($delimiters)) {\n        return $parts;\n    }\n    \n    \/\/ \u5404\u90e8\u5206\u306b\u5bfe\u3057\u3066\u6b8b\u308a\u306e\u30c7\u30ea\u30df\u30bf\u3067\u518d\u5e30\u7684\u306b\u5206\u5272\n    $result = [];\n    foreach ($parts as $part) {\n        $sub_parts = hierarchical_split($part, $delimiters);\n        $result[] = $sub_parts;\n    }\n    \n    return $result;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"Section 1:Line 1,Item 1 Item 2,Line 2:Section 2:Line 1\";\n$result = hierarchical_split($text, [':', ',']);\n\/* \n\u7d50\u679c\uff08\u968e\u5c64\u69cb\u9020\uff09:\n[\n    [\n        \"Section 1\",\n        [\"Line 1\", \"Item 1 Item 2\", \"Line 2\"]\n    ],\n    [\n        \"Section 2\",\n        [\"Line 1\"]\n    ]\n]\n*\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-24\">JSON\u6587\u5b57\u5217\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u9ad8\u5ea6\u306a\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u73fe\u4ee3\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u306f\u3001JSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3053\u3068\u304c\u975e\u5e38\u306b\u591a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-25\">\u57fa\u672c\u7684\u306aJSON\u89e3\u6790<\/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=\"\">function extract_json_data($json_string) {\n    \/\/ \u7b2c2\u5f15\u6570\u3092true\u306b\u3059\u308b\u3068\u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u308b\uff08false\u306e\u5834\u5408\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\n    return json_decode($json_string, true);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$json = '{\"user\":{\"name\":\"John\",\"email\":\"john@example.com\",\"roles\":[\"admin\",\"editor\"]}}';\n$data = extract_json_data($json);\necho $data['user']['name']; \/\/ \"John\"\necho implode(', ', $data['user']['roles']); \/\/ \"admin, editor\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-26\">\u30cd\u30b9\u30c8\u3055\u308c\u305fJSON\u5024\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/h4>\n\n\n\n<p>\u8907\u96d1\u306aJSON\u69cb\u9020\u304b\u3089\u7279\u5b9a\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\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=\"\">function get_nested_json_value($json_string, $keys) {\n    $data = json_decode($json_string, true);\n    if (!$data) return null;\n    \n    foreach ($keys as $key) {\n        if (!isset($data[$key])) return null;\n        $data = $data[$key];\n    }\n    \n    return $data;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$json = '{\"data\":{\"user\":{\"profile\":{\"name\":\"Jane\",\"age\":28}}}}';\n$name = get_nested_json_value($json, ['data', 'user', 'profile', 'name']);\n\/\/ \u7d50\u679c: \"Jane\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-27\">JSONPath\u98a8\u306e\u62bd\u51fa\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u3088\u308a\u8907\u96d1\u306aJSON\u64cd\u4f5c\u306e\u305f\u3081\u306eJSONPath\u98a8\u306e\u62bd\u51fa\u6a5f\u80fd\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=\"\">function json_path_query($json, $path) {\n    $data = is_string($json) ? json_decode($json, true) : $json;\n    if (!$data) return null;\n    \n    $path_parts = explode('.', $path);\n    $current = $data;\n    \n    foreach ($path_parts as $part) {\n        \/\/ \u914d\u5217\u30a2\u30af\u30bb\u30b9\uff08\u4f8b\uff1ausers[0]\uff09\n        if (preg_match('\/^(.+)\\[([0-9]+)\\]$\/', $part, $matches)) {\n            $key = $matches[1];\n            $index = (int)$matches[2];\n            \n            if (!isset($current[$key]) || !is_array($current[$key]) || \n                !isset($current[$key][$index])) {\n                return null;\n            }\n            \n            $current = $current[$key][$index];\n        } else {\n            \/\/ \u901a\u5e38\u306e\u30ad\u30fc\u30a2\u30af\u30bb\u30b9\n            if (!isset($current[$part])) {\n                return null;\n            }\n            \n            $current = $current[$part];\n        }\n    }\n    \n    return $current;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$json = '{\"users\":[{\"name\":\"John\",\"age\":30},{\"name\":\"Jane\",\"age\":25}]}';\n$first_user_name = json_path_query($json, 'users[0].name');\n\/\/ \u7d50\u679c: \"John\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-28\">\u5927\u5bb9\u91cf\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3059\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u5927\u5bb9\u91cf\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u91cd\u8981\u306a\u8003\u616e\u4e8b\u9805\u306b\u306a\u308a\u307e\u3059\u3002PHP\u306b\u306f\u52b9\u7387\u7684\u306a\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u306e\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-29\">\u884c\u3054\u3068\u306e\u51e6\u7406\u30a2\u30d7\u30ed\u30fc\u30c1<\/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=\"\">function process_large_file_by_line($filename, $callback) {\n    $handle = fopen($filename, 'r');\n    if (!$handle) return false;\n    \n    while (($line = fgets($handle)) !== false) {\n        \/\/ \u5404\u884c\u306b\u5bfe\u3057\u3066\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u5b9f\u884c\n        $callback(trim($line));\n    }\n    \n    fclose($handle);\n    return true;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nprocess_large_file_by_line('large_log.txt', function($line) {\n    \/\/ \u4f8b\uff1a\u30a8\u30e9\u30fc\u3092\u542b\u3080\u884c\u3060\u3051\u3092\u51e6\u7406\n    if (strpos($line, 'ERROR') !== false) {\n        echo \"Found error: $line\\n\";\n    }\n});\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-30\">\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u3063\u305f\u52b9\u7387\u7684\u306a\u51e6\u7406<\/h4>\n\n\n\n<p>PHP 5.5.0\u4ee5\u964d\u3067\u306f\u3001\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u826f\u3044\u51e6\u7406\u304c\u53ef\u80fd\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=\"\">function readLines($filename) {\n    $handle = fopen($filename, 'r');\n    if (!$handle) return;\n    \n    while (($line = fgets($handle)) !== false) {\n        yield trim($line);\n    }\n    \n    fclose($handle);\n}\n\nfunction processLargeFile($filename) {\n    foreach (readLines($filename) as $line) {\n        \/\/ \u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u304b\u3089\u4e00\u884c\u305a\u3064\u53d6\u5f97\u3057\u3066\u51e6\u7406\n        if (strpos($line, 'target text') !== false) {\n            echo \"Found line: $line\\n\";\n        }\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nprocessLargeFile('very_large_file.txt');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-31\">\u30c1\u30e3\u30f3\u30af\u5358\u4f4d\u306e\u4e26\u5217\u51e6\u7406<\/h4>\n\n\n\n<p>\u975e\u5e38\u306b\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3001\u8907\u6570\u306e\u30d7\u30ed\u30bb\u30b9\u3067\u5206\u6563\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\u52b9\u7387\u3092\u4e0a\u3052\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=\"\">function process_file_in_parallel($filename, $num_workers = 4) {\n    $filesize = filesize($filename);\n    $chunk_size = ceil($filesize \/ $num_workers);\n    \n    for ($i = 0; $i &lt; $num_workers; $i++) {\n        $start = $i * $chunk_size;\n        $length = min($chunk_size, $filesize - $start);\n        \n        \/\/ \u5b9f\u969b\u306e\u74b0\u5883\u3067\u306f\u3001\u3053\u3053\u3067\u5225\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\n        \/\/ \u4f8b: shell_exec(\"php worker.php $filename $start $length &gt; \/tmp\/worker_$i.log 2&gt;&amp;1 &amp;\");\n        \n        \/\/ \u30c7\u30e2\u30f3\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u7528\u306b\u540c\u671f\u51e6\u7406\n        process_file_chunk($filename, $start, $length);\n    }\n}\n\nfunction process_file_chunk($filename, $start, $length) {\n    $handle = fopen($filename, 'r');\n    if (!$handle) return;\n    \n    fseek($handle, $start);\n    $data = fread($handle, $length);\n    fclose($handle);\n    \n    \/\/ \u30c7\u30fc\u30bf\u306e\u5883\u754c\u8abf\u6574\uff08\u884c\u306e\u9014\u4e2d\u3067\u5207\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\uff09\n    \/\/ \u6700\u521d\u3068\u6700\u5f8c\u306e\u6539\u884c\u4f4d\u7f6e\u3092\u898b\u3064\u3051\u308b\n    $first_newline = ($start &gt; 0) ? strpos($data, \"\\n\") : false;\n    $last_newline = strrpos($data, \"\\n\");\n    \n    if ($start &gt; 0 &amp;&amp; $first_newline !== false) {\n        \/\/ \u6700\u521d\u306e\u4e0d\u5b8c\u5168\u306a\u884c\u3092\u524a\u9664\n        $data = substr($data, $first_newline + 1);\n    }\n    \n    if ($last_newline !== false) {\n        \/\/ \u6700\u5f8c\u306e\u4e0d\u5b8c\u5168\u306a\u884c\u3092\u524a\u9664\n        $data = substr($data, 0, $last_newline + 1);\n    }\n    \n    \/\/ \u884c\u3054\u3068\u306b\u51e6\u7406\n    $lines = explode(\"\\n\", $data);\n    foreach ($lines as $line) {\n        if (empty($line)) continue;\n        \n        \/\/ \u5404\u884c\u306e\u51e6\u7406\u30ed\u30b8\u30c3\u30af\n        \/\/ \u4f8b: \u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3059\u308b\u884c\u3060\u3051\u3092\u51e6\u7406\n        if (preg_match('\/pattern\/', $line)) {\n            \/\/ \u51e6\u7406...\n        }\n    }\n}\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7fd2\u5f97\u3059\u308b\u3053\u3068\u3067\u3001\u69d8\u3005\u306a\u6587\u5b57\u5217\u51e6\u7406\u306e\u8ab2\u984c\u306b\u52b9\u7387\u7684\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u6700\u9069\u306a\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3084\u51e6\u7406\u901f\u5ea6\u3092\u610f\u8b58\u3057\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-32\">\u6587\u5b57\u5217\u5206\u5272\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/h2>\n\n\n\n<p>\u6587\u5b57\u5217\u5206\u5272\u306f\u4e00\u898b\u30b7\u30f3\u30d7\u30eb\u306a\u64cd\u4f5c\u306b\u601d\u3048\u307e\u3059\u304c\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u9762\u3067\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u91cd\u8981\u306a\u554f\u984c\u3068\u306a\u308a\u307e\u3059\u3002\u9069\u5207\u306a\u95a2\u6570\u9078\u629e\u3068\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u3092\u77e5\u308b\u3053\u3068\u3067\u3001\u51e6\u7406\u901f\u5ea6\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u524a\u6e1b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-33\">\u5404\u5206\u5272\u95a2\u6570\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03<\/h3>\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u306b\u306f\u660e\u78ba\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5dee\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u8868\u306f\u4e3b\u8981\u306a\u95a2\u6570\u306e\u76f8\u5bfe\u7684\u306a\u901f\u5ea6\u3068\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6bd4\u8f03\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n<div id=\"id-88cc8496-0a0c-41ce-910a-ca024e9eee36\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u95a2\u6570<\/th><th>\u76f8\u5bfe\u901f\u5ea6<\/th><th>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf<\/th><th>\u5099\u8003<\/th><\/tr><\/thead><tbody><tr><td><code>explode()<\/code><\/td><td>1.0 (\u6700\u901f)<\/td><td>\u4f4e<\/td><td>\u6700\u3082\u52b9\u7387\u7684\u3001\u5358\u4e00\u30c7\u30ea\u30df\u30bf\u306e\u307f<\/td><\/tr><tr><td><code>str_split()<\/code><\/td><td>1.2<\/td><td>\u4f4e<\/td><td>\u56fa\u5b9a\u9577\u5206\u5272\u306b\u6700\u9069<\/td><\/tr><tr><td><code>strtok()<\/code><\/td><td>1.5<\/td><td>\u6700\u4f4e<\/td><td>\u30a4\u30c6\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3\u3067\u6700\u5c0f\u30e1\u30e2\u30ea\u4f7f\u7528<\/td><\/tr><tr><td><code>mb_str_split()<\/code><\/td><td>3.0<\/td><td>\u4e2d<\/td><td>PHP 7.4\u4ee5\u964d\u3067\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc<\/td><\/tr><tr><td><code>mb_split()<\/code><\/td><td>4.0<\/td><td>\u4e2d\uff5e\u9ad8<\/td><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u6b63\u898f\u8868\u73fe<\/td><\/tr><tr><td><code>preg_split()<\/code> (\u30b7\u30f3\u30d7\u30eb)<\/td><td>3.5<\/td><td>\u4e2d<\/td><td>\u6b63\u898f\u8868\u73fe\u30a8\u30f3\u30b8\u30f3\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3042\u308a<\/td><\/tr><tr><td><code>preg_split()<\/code> (\u8907\u96d1)<\/td><td>5.0+<\/td><td>\u4e2d\uff5e\u9ad8<\/td><td>\u30d1\u30bf\u30fc\u30f3\u306e\u8907\u96d1\u3055\u306b\u5fdc\u3058\u3066\u9045\u304f\u306a\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u5b9f\u969b\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3067\u306f\u300110,000\u56de\u306e\u7e70\u308a\u8fd4\u3057\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7d50\u679c\u304c\u5f97\u3089\u308c\u307e\u3057\u305f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u5358\u7d14\u6587\u5b57\u5217\u51e6\u7406\uff1a\n<ul class=\"wp-block-list\">\n<li><code>explode()<\/code>: 0.0023\u79d2<\/li>\n\n\n\n<li><code>str_split()<\/code>: 0.0029\u79d2<\/li>\n\n\n\n<li><code>preg_split()<\/code>: 0.0083\u79d2<\/li>\n\n\n\n<li><code>strtok()<\/code>: 0.0035\u79d2<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u7d50\u679c\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u9078\u629e\u57fa\u6e96\u304c\u5c0e\u304d\u51fa\u305b\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30b7\u30f3\u30d7\u30eb\u306a\u5358\u4e00\u30c7\u30ea\u30df\u30bf \u2192 <code>explode()<\/code>\u304c\u6700\u9069<\/li>\n\n\n\n<li>\u56fa\u5b9a\u9577\u5206\u5272 \u2192 <code>str_split()<\/code>\u304c\u6700\u9069<\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3 \u2192 <code>preg_split()<\/code>\u304c\u5fc5\u8981\u3060\u304c\u9045\u3044<\/li>\n\n\n\n<li>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57 \u2192 <code>mb_str_split()<\/code>\uff08PHP 7.4\u4ee5\u964d\uff09\u307e\u305f\u306f <code>mb_split()<\/code><\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u304c\u53b3\u3057\u304f\u5236\u9650\u3055\u308c\u305f\u74b0\u5883 \u2192 <code>strtok()<\/code>\u3092\u691c\u8a0e<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-34\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6291\u3048\u308b\u52b9\u7387\u7684\u306a\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u6700\u9069\u5316\u304c\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u52b9\u7387\u7684\u306a\u30e1\u30e2\u30ea\u4f7f\u7528\u306e\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-35\">1. strtok()\u3092\u4f7f\u3063\u305f\u6700\u5c0f\u30e1\u30e2\u30ea\u53cd\u5fa9\u51e6\u7406<\/h4>\n\n\n\n<p><code>strtok()<\/code>\u95a2\u6570\u306f\u914d\u5217\u3092\u4f5c\u6210\u305b\u305a\u3001\u4e00\u5ea6\u306b1\u3064\u306e\u30c8\u30fc\u30af\u30f3\u3060\u3051\u3092\u8fd4\u3059\u305f\u3081\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u975e\u5e38\u306b\u5c11\u306a\u304f\u306a\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=\"\">function process_string_tokens($string, $delimiter) {\n    \/\/ \u6700\u521d\u306e\u547c\u3073\u51fa\u3057\u3067\u306f\u6587\u5b57\u5217\u3068\u30c7\u30ea\u30df\u30bf\u3092\u6307\u5b9a\n    $token = strtok($string, $delimiter);\n    \n    while ($token !== false) {\n        \/\/ \u30c8\u30fc\u30af\u30f3\u3092\u51e6\u7406\n        echo \"Token: $token\\n\";\n        \n        \/\/ 2\u56de\u76ee\u4ee5\u964d\u306e\u547c\u3073\u51fa\u3057\u3067\u306f\u30c7\u30ea\u30df\u30bf\u306e\u307f\u3092\u6307\u5b9a\n        $token = strtok($delimiter);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"apple,banana,orange,grape,melon\";\nprocess_string_tokens($text, ',');\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-36\">2. \u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p>PHP 5.5.0\u4ee5\u964d\u3067\u306f\u3001\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u5927\u304d\u306a\u914d\u5217\u3092\u30e1\u30e2\u30ea\u306b\u4fdd\u6301\u305b\u305a\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=\"\">function string_tokens($string, $delimiter) {\n    $tokens = explode($delimiter, $string);\n    foreach ($tokens as $token) {\n        yield $token; \/\/ 1\u3064\u305a\u3064\u5024\u3092\u8fd4\u3057\u3001\u72b6\u614b\u3092\u4fdd\u6301\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"apple,banana,orange,grape,melon\";\nforeach (string_tokens($text, ',') as $token) {\n    echo \"Token: $token\\n\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-37\">3. \u90e8\u5206\u7684\u51e6\u7406\u3067\u30e1\u30e2\u30ea\u5727\u8feb\u3092\u9632\u3050<\/h4>\n\n\n\n<p>\u975e\u5e38\u306b\u5927\u304d\u306a\u6587\u5b57\u5217\u3092\u6271\u3046\u5834\u5408\u306f\u3001\u5168\u4f53\u3092\u4e00\u5ea6\u306b\u51e6\u7406\u305b\u305a\u3001\u90e8\u5206\u7684\u306b\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\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=\"\">function process_large_string_in_chunks($string, $delimiter, $chunk_size = 1000) {\n    $offset = 0;\n    $length = strlen($string);\n    \n    while ($offset &lt; $length) {\n        \/\/ \u6587\u5b57\u5217\u306e\u4e00\u90e8\u3092\u53d6\u5f97\n        $chunk = substr($string, $offset, $chunk_size);\n        \n        \/\/ \u30c7\u30ea\u30df\u30bf\u306e\u6700\u5f8c\u306e\u4f4d\u7f6e\u3092\u898b\u3064\u3051\u308b\n        $last_delimiter = strrpos($chunk, $delimiter);\n        \n        if ($last_delimiter !== false) {\n            \/\/ \u30c7\u30ea\u30df\u30bf\u306e\u4f4d\u7f6e\u307e\u3067\u306e\u90e8\u5206\u6587\u5b57\u5217\u3092\u51e6\u7406\n            $process_chunk = substr($chunk, 0, $last_delimiter);\n            $tokens = explode($delimiter, $process_chunk);\n            \n            \/\/ \u30c8\u30fc\u30af\u30f3\u3092\u51e6\u7406\n            foreach ($tokens as $token) {\n                echo \"Token: $token\\n\";\n            }\n            \n            \/\/ \u30aa\u30d5\u30bb\u30c3\u30c8\u3092\u66f4\u65b0\n            $offset += $last_delimiter + strlen($delimiter);\n        } else {\n            \/\/ \u30c7\u30ea\u30df\u30bf\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u30c1\u30e3\u30f3\u30af\u3078\n            $offset += $chunk_size;\n        }\n    }\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-38\">\u51e6\u7406\u901f\u5ea6\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u5206\u5272\u51e6\u7406\u306e\u901f\u5ea6\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-39\">1. \u30eb\u30fc\u30d7\u5916\u3067\u6e96\u5099\u4f5c\u696d\u3092\u884c\u3046<\/h4>\n\n\n\n<p>\u30eb\u30fc\u30d7\u5185\u3067\u6bce\u56de\u5b9f\u884c\u3055\u308c\u308b\u51e6\u7406\u306f\u3001\u53ef\u80fd\u306a\u9650\u308a\u30eb\u30fc\u30d7\u306e\u5916\u306b\u79fb\u52d5\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=\"\">\/\/ \u975e\u52b9\u7387\u306a\u4f8b\nfunction process_inefficient($lines) {\n    $results = [];\n    for ($i = 0; $i &lt; count($lines); $i++) { \/\/ count()\u304c\u6bce\u56de\u5b9f\u884c\u3055\u308c\u308b\n        if (preg_match('\/pattern\/', $lines[$i])) { \/\/ \u30d1\u30bf\u30fc\u30f3\u304c\u6bce\u56de\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u308b\n            $results[] = $lines[$i];\n        }\n    }\n    return $results;\n}\n\n\/\/ \u52b9\u7387\u7684\u306a\u4f8b\nfunction process_efficient($lines) {\n    $results = [];\n    $count = count($lines); \/\/ \u4e00\u5ea6\u3060\u3051count()\u3092\u5b9f\u884c\n    $pattern = '\/pattern\/'; \/\/ \u30d1\u30bf\u30fc\u30f3\u3092\u4e00\u5ea6\u3060\u3051\u6e96\u5099\n    \n    for ($i = 0; $i &lt; $count; $i++) {\n        if (preg_match($pattern, $lines[$i])) {\n            $results[] = $lines[$i];\n        }\n    }\n    return $results;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-40\">2. \u6b63\u898f\u8868\u73fe\u306e\u4ee3\u308f\u308a\u306b\u5358\u7d14\u306a\u95a2\u6570\u3092\u4f7f\u7528<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u304c\u5fc5\u8981\u306a\u3044\u5834\u5408\u306f\u3001\u3088\u308a\u9ad8\u901f\u306a\u4ee3\u66ff\u624b\u6bb5\u3092\u9078\u3073\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=\"\">\/\/ \u975e\u52b9\u7387\u306a\u4f8b\uff08\u5358\u7d14\u306a\u533a\u5207\u308a\u306b\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\uff09\n$parts = preg_split('\/,\/', $csv_line);\n\n\/\/ \u52b9\u7387\u7684\u306a\u4f8b\n$parts = explode(',', $csv_line);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-41\">3. \u8907\u96d1\u306a\u6b63\u898f\u8868\u73fe\u306e\u6700\u9069\u5316<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u3067\u304d\u308b\u3060\u3051\u6700\u9069\u5316\u3057\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=\"\">\/\/ \u975e\u52b9\u7387\u306a\u6b63\u898f\u8868\u73fe\n$pattern = '\/.*?(pattern).*?\/i'; \/\/ \u8caa\u6b32\u306a\u30de\u30c3\u30c1\u30f3\u30b0\u3068\u4e0d\u8981\u306a\u90e8\u5206\n\n\/\/ \u52b9\u7387\u7684\u306a\u6b63\u898f\u8868\u73fe\n$pattern = '\/pattern\/i'; \/\/ \u5fc5\u8981\u306a\u90e8\u5206\u3060\u3051\u3092\u30de\u30c3\u30c1\u30f3\u30b0\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-42\">4. \u52b9\u7387\u7684\u306a\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u30af\u30e9\u30b9\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u983b\u7e41\u306b\u6587\u5b57\u5217\u5206\u5272\u3092\u884c\u3046\u5834\u5408\u306f\u3001\u5c02\u7528\u306e\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u4fbf\u5229\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=\"\">class StringTokenizer {\n    private $tokens;\n    private $position;\n    \n    public function __construct($string, $delimiter) {\n        $this-&gt;tokens = explode($delimiter, $string);\n        $this-&gt;position = 0;\n    }\n    \n    public function hasMoreTokens() {\n        return $this-&gt;position &lt; count($this-&gt;tokens);\n    }\n    \n    public function nextToken() {\n        if (!$this-&gt;hasMoreTokens()) {\n            return null;\n        }\n        return $this-&gt;tokens[$this-&gt;position++];\n    }\n    \n    public function reset() {\n        $this-&gt;position = 0;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$tokenizer = new StringTokenizer(\"a,b,c,d\", \",\");\nwhile ($tokenizer-&gt;hasMoreTokens()) {\n    echo $tokenizer-&gt;nextToken() . \"\\n\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-43\">\u6700\u9069\u5316\u306e\u305f\u3081\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h3>\n\n\n\n<p>\u6587\u5b57\u5217\u5206\u5272\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u305f\u3081\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u2713 \u6700\u9069\u306a\u5206\u5272\u95a2\u6570\u3092\u9078\u629e\u3057\u3066\u3044\u308b\u304b\uff08explode &gt; str_split &gt; preg_split\uff09<\/li>\n\n\n\n<li>\u2713 \u6b63\u898f\u8868\u73fe\u306f\u5fc5\u8981\u306a\u5834\u5408\u306e\u307f\u4f7f\u7528\u3057\u3001\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>\u2713 \u30eb\u30fc\u30d7\u306e\u5916\u3067\u8a08\u7b97\u3067\u304d\u308b\u3082\u306e\u306f\u30eb\u30fc\u30d7\u5916\u306b\u79fb\u52d5\u3057\u305f\u304b<\/li>\n\n\n\n<li>\u2713 \u5927\u304d\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u30b9\u30c8\u30ea\u30fc\u30e0\u51e6\u7406\u3084\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3067\u51e6\u7406\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>\u2713 PHP 7.4\u4ee5\u964d\u3067\u306fmb_str_split()\u3092\u6d3b\u7528\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>\u2713 \u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306f\u8a31\u5bb9\u7bc4\u56f2\u5185\u304b<\/li>\n\n\n\n<li>\u2713 \u9069\u5207\u306a\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u304b<\/li>\n<\/ol>\n\n\n\n<p>\u9069\u5207\u306a\u95a2\u6570\u9078\u629e\u3068\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6587\u5b57\u5217\u5206\u5272\u51e6\u7406\u306e\u52b9\u7387\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8981\u4ef6\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u76ee\u6a19\u306b\u5408\u308f\u305b\u3066\u3001\u6700\u9069\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u9078\u629e\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-44\">\u6587\u5b57\u5217\u5206\u5272\u306b\u304a\u3051\u308b\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5<\/h2>\n\n\n\n<p>PHP\u3067\u306e\u6587\u5b57\u5217\u5206\u5272\u306f\u4e00\u898b\u30b7\u30f3\u30d7\u30eb\u306a\u64cd\u4f5c\u306b\u601d\u3048\u307e\u3059\u304c\u3001\u5b9f\u969b\u306e\u958b\u767a\u3067\u306f\u69d8\u3005\u306a\u30a8\u30e9\u30fc\u3084\u554f\u984c\u306b\u906d\u9047\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u3088\u304f\u767a\u751f\u3059\u308b\u554f\u984c\u3068\u305d\u306e\u5bfe\u51e6\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-45\">Null\u5024\u3084\u7a7a\u6587\u5b57\u306e\u9069\u5207\u306a\u51e6\u7406\u65b9\u6cd5<\/h3>\n\n\n\n<p>Null\u5024\u3084\u7a7a\u6587\u5b57\u3092\u5206\u5272\u95a2\u6570\u306b\u6e21\u3057\u305f\u5834\u5408\u3001\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3084\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-46\">Null\u5024\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>Null\u3092\u5206\u5272\u95a2\u6570\u306b\u6e21\u3057\u305f\u5834\u5408\u3001PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u52d5\u4f5c\u304c\u7570\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP 8.0\u672a\u6e80: Warning\u304c\u767a\u751f\u3057\u3001false\u304c\u8fd4\u3055\u308c\u308b<\/li>\n\n\n\n<li>PHP 8.0\u4ee5\u964d: TypeError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b<\/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=\"\">\/\/ PHP 8.0\u672a\u6e80\n$result = @explode(',', null); \/\/ Warning (\u6291\u5236) + false\nvar_dump($result); \/\/ bool(false)\n\n\/\/ PHP 8.0\u4ee5\u964d\ntry {\n    $result = explode(',', null);\n} catch (TypeError $e) {\n    echo $e-&gt;getMessage(); \/\/ \"explode(): Argument #2 ($string) must be of type string, null given\"\n}\n<\/pre>\n\n\n\n<p>\u5b89\u5168\u306b\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\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=\"\">function safe_explode($delimiter, $string, $default = []) {\n    if ($string === null) {\n        return $default;\n    }\n    return explode($delimiter, $string);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$value = null;\n$parts = safe_explode(',', $value); \/\/ []\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-47\">\u7a7a\u6587\u5b57\u5217\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u7a7a\u306e\u6587\u5b57\u5217\u3092\u5206\u5272\u3059\u308b\u3068\u3001\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\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=\"\">$result = explode(',', '');\nvar_dump($result); \/\/ array(1) { [0]=&gt; string(0) \"\" }\n<\/pre>\n\n\n\n<p>\u7a7a\u6587\u5b57\u5217\u306e\u5834\u5408\u306b\u7a7a\u914d\u5217\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u305f\u3044\u5834\u5408\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=\"\">function explode_non_empty($delimiter, $string) {\n    if ($string === '') {\n        return [];\n    }\n    return explode($delimiter, $string);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$value = '';\n$parts = explode_non_empty(',', $value); \/\/ []\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-48\">\u7a7a\u30c7\u30ea\u30df\u30bf\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u7a7a\u306e\u30c7\u30ea\u30df\u30bf\u3067\u5206\u5272\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\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=\"\">\/\/ PHP 8.0\u672a\u6e80\n$result = @explode('', 'abc'); \/\/ Warning (\u6291\u5236) + false\n\n\/\/ PHP 8.0\u4ee5\u964d\ntry {\n    $result = explode('', 'abc');\n} catch (ValueError $e) {\n    echo $e-&gt;getMessage(); \/\/ \"explode(): Argument #1 ($separator) cannot be empty\"\n}\n<\/pre>\n\n\n\n<p>\u7a7a\u30c7\u30ea\u30df\u30bf\u306e\u4ee3\u66ff\u51e6\u7406\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=\"\">function safe_split($delimiter, $string) {\n    if ($delimiter === '') {\n        \/\/ \u7a7a\u30c7\u30ea\u30df\u30bf\u306e\u5834\u5408\u306f1\u6587\u5b57\u305a\u3064\u5206\u5272\n        return str_split($string);\n    }\n    return explode($delimiter, $string);\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$text = \"abc\";\n$parts = safe_split('', $text); \/\/ ['a', 'b', 'c']\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-49\">\u3042\u3089\u3086\u308b\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3059\u308b\u5805\u7262\u306a\u95a2\u6570<\/h4>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5805\u7262\u306a\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u4fbf\u5229\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=\"\">function robust_explode($delimiter, $string, $default = []) {\n    \/\/ \u7121\u52b9\u306a\u5165\u529b\u30c1\u30a7\u30c3\u30af\n    if ($delimiter === '' || $string === null) {\n        return $default;\n    }\n    \n    \/\/ \u7a7a\u6587\u5b57\u5217\u30c1\u30a7\u30c3\u30af\uff08\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\uff09\n    if ($string === '') {\n        return [''];  \/\/ \u307e\u305f\u306f return []; \u3068\u3057\u3066\u3082\u826f\u3044\n    }\n    \n    \/\/ \u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\uff08PHP 8.0\u4ee5\u964d\u5bfe\u5fdc\uff09\n    try {\n        return explode($delimiter, $string);\n    } catch (Throwable $e) {\n        error_log(\"String split error: \" . $e-&gt;getMessage());\n        return $default;\n    }\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-50\">\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u95a2\u9023\u3059\u308b\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h3>\n\n\n\n<p>\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6271\u3046\u969b\u306f\u3001\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u95a2\u9023\u3059\u308b\u554f\u984c\u304c\u3088\u304f\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-51\">\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u4e0d\u4e00\u81f4<\/h4>\n\n\n\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3001\u5165\u529b\u30c7\u30fc\u30bf\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u3001\u6587\u5b57\u5316\u3051\u3084\u4e88\u671f\u3057\u306a\u3044\u5206\u5272\u7d50\u679c\u304c\u751f\u3058\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=\"\">\/\/ UTF-8\u306e\u65e5\u672c\u8a9e\u3092SJIS\u3068\u3057\u3066\u51e6\u7406\u3059\u308b\u3068\u30a8\u30e9\u30fc\n$text = \"\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c\"; \/\/ UTF-8\n$parts = str_split($text); \/\/ \u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u5206\u5272\u3055\u308c\u3066\u3057\u307e\u3046\n\/\/ \u7d50\u679c: \u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u304c\u58ca\u308c\u308b\n<\/pre>\n\n\n\n<p>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u7d71\u4e00\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\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=\"\">\/\/ \u30b9\u30af\u30ea\u30d7\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u305f\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u8a2d\u5b9a\nmb_internal_encoding('UTF-8');\nmb_http_output('UTF-8');\nmb_regex_encoding('UTF-8');\nmb_language('Japanese'); \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-52\">UTF-8 BOM\u306e\u554f\u984c<\/h4>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3060\u30c6\u30ad\u30b9\u30c8\u306bUTF-8 BOM\uff08Byte Order Mark\uff09\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3068\u3001\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3092\u5f15\u304d\u8d77\u3053\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=\"\">\/\/ BOM\u3092\u524a\u9664\u3059\u308b\u95a2\u6570\nfunction remove_utf8_bom($text) {\n    $bom = pack('H*', 'EFBBBF');\n    if (strncmp($text, $bom, 3) === 0) {\n        return substr($text, 3);\n    }\n    return $text;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$file_content = file_get_contents('utf8_file_with_bom.txt');\n$cleaned_content = remove_utf8_bom($file_content);\n$lines = explode(\"\\n\", $cleaned_content);\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-53\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306e\u6b63\u3057\u3044\u51e6\u7406<\/h4>\n\n\n\n<p>\u6a19\u6e96\u306e\u5206\u5272\u95a2\u6570\u3067\u306f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u6b63\u3057\u304f\u51e6\u7406\u3067\u304d\u307e\u305b\u3093\u3002PHP 7.4\u4ee5\u964d\u306f<code>mb_str_split()<\/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=\"\">function split_mb_string($string, $length = 1) {\n    if (function_exists('mb_str_split')) {\n        \/\/ PHP 7.4\u4ee5\u964d\n        return mb_str_split($string, $length);\n    } else {\n        \/\/ PHP 7.4\u672a\u6e80\u306e\u5834\u5408\u306e\u30dd\u30ea\u30d5\u30a3\u30eb\n        $result = [];\n        $strlen = mb_strlen($string);\n        for ($i = 0; $i &lt; $strlen; $i += $length) {\n            $result[] = mb_substr($string, $i, $length);\n        }\n        return $result;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$japanese = \"\u3053\u3093\u306b\u3061\u306f\";\n$chars = split_mb_string($japanese);\n\/\/ \u7d50\u679c: ['\u3053', '\u3093', '\u306b', '\u3061', '\u306f']\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-54\">\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u691c\u51fa\u3068\u5909\u63db<\/h4>\n\n\n\n<p>\u5165\u529b\u6587\u5b57\u5217\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u4e0d\u660e\u306a\u5834\u5408\u306f\u3001\u691c\u51fa\u3057\u3066\u5909\u63db\u3057\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=\"\">function safe_split_japanese($delimiter, $string) {\n    \/\/ \u5165\u529b\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u691c\u51fa\n    $detected = mb_detect_encoding($string, 'UTF-8, SJIS, EUC-JP', true);\n    \n    \/\/ UTF-8\u306b\u7d71\u4e00\n    if ($detected &amp;&amp; $detected !== 'UTF-8') {\n        $string = mb_convert_encoding($string, 'UTF-8', $detected);\n    }\n    \n    \/\/ \u30c7\u30ea\u30df\u30bf\u3082\u5909\u63db\n    if ($detected &amp;&amp; $detected !== 'UTF-8') {\n        $delimiter = mb_convert_encoding($delimiter, 'UTF-8', $detected);\n    }\n    \n    \/\/ \u5206\u5272\u51e6\u7406\n    return mb_split($delimiter, $string);\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-55\">\u9577\u5927\u306a\u6587\u5b57\u5217\u3092\u6271\u3046\u969b\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>\u5927\u304d\u306a\u6587\u5b57\u5217\u3092\u51e6\u7406\u3059\u308b\u969b\u306f\u3001\u30e1\u30e2\u30ea\u3084\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u554f\u984c\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-56\">\u30e1\u30e2\u30ea\u5236\u9650\u306e\u554f\u984c<\/h4>\n\n\n\n<p>\u5927\u304d\u306a\u6587\u5b57\u5217\u3092\u51e6\u7406\u3059\u308b\u3068\u300cAllowed memory size exhausted\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\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=\"\">\/\/ \u30e1\u30e2\u30ea\u5236\u9650\u3092\u4e00\u6642\u7684\u306b\u8abf\u6574\nini_set('memory_limit', '512M');\n\n\/\/ \u3088\u308a\u826f\u3044\u89e3\u6c7a\u7b56: \u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u30a2\u30d7\u30ed\u30fc\u30c1\nfunction process_large_file($filename, $delimiter, $callback) {\n    $handle = fopen($filename, 'r');\n    if (!$handle) return false;\n    \n    while (!feof($handle)) {\n        $line = fgets($handle);\n        $parts = explode($delimiter, $line);\n        $callback($parts); \/\/ \u5404\u884c\u306e\u5206\u5272\u7d50\u679c\u3092\u51e6\u7406\n    }\n    \n    fclose($handle);\n    return true;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nprocess_large_file('large_data.csv', ',', function($columns) {\n    \/\/ \u5404\u884c\u306e\u51e6\u7406...\n    echo $columns[0] . \"\\n\";\n});\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-57\">\u30c1\u30e3\u30f3\u30af\u51e6\u7406\u306b\u3088\u308b\u52b9\u7387\u5316<\/h4>\n\n\n\n<p>\u975e\u5e38\u306b\u5927\u304d\u306a\u6587\u5b57\u5217\u3092\u6271\u3046\u5834\u5408\u306f\u3001\u30c1\u30e3\u30f3\u30af\u306b\u5206\u5272\u3057\u3066\u51e6\u7406\u3057\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=\"\">function split_and_process_chunks($string, $delimiter, $chunk_size = 1000000) {\n    $total_length = strlen($string);\n    $offset = 0;\n    \n    while ($offset &lt; $total_length) {\n        \/\/ \u30c1\u30e3\u30f3\u30af\u3092\u53d6\u5f97\n        $chunk = substr($string, $offset, $chunk_size);\n        \n        \/\/ \u30c1\u30e3\u30f3\u30af\u306e\u672b\u5c3e\u304c\u4e2d\u9014\u534a\u7aef\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\n        $last_pos = strrpos($chunk, $delimiter);\n        if ($last_pos !== false) {\n            $chunk = substr($chunk, 0, $last_pos + strlen($delimiter));\n            $process_length = $last_pos + strlen($delimiter);\n        } else {\n            $process_length = strlen($chunk);\n        }\n        \n        \/\/ \u30c1\u30e3\u30f3\u30af\u3092\u51e6\u7406\n        $parts = explode($delimiter, $chunk);\n        foreach ($parts as $part) {\n            \/\/ \u5404\u90e8\u5206\u3092\u51e6\u7406...\n            process_part($part);\n        }\n        \n        \/\/ \u30aa\u30d5\u30bb\u30c3\u30c8\u3092\u66f4\u65b0\n        $offset += $process_length;\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-58\">\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u5bfe\u7b56<\/h4>\n\n\n\n<p>\u9577\u6642\u9593\u306e\u51e6\u7406\u306b\u3088\u308b\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u9632\u3050\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u5bfe\u7b56\u304c\u6709\u52b9\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=\"\">\/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u3092\u8abf\u6574\uff08\u79d2\u5358\u4f4d\uff09\nset_time_limit(300); \/\/ 5\u5206\n\n\/\/ \u9032\u6357\u72b6\u6cc1\u3092\u5831\u544a\u3059\u308b\u51e6\u7406\nfunction process_with_progress($string, $delimiter, $callback) {\n    $total_length = strlen($string);\n    $processed = 0;\n    $chunk_size = 1000000; \/\/ 1MB\u3054\u3068\u306b\u51e6\u7406\n    \n    while ($processed &lt; $total_length) {\n        $chunk = substr($string, $processed, $chunk_size);\n        \n        \/\/ \u51e6\u7406\u3068\u30d7\u30ed\u30b0\u30ec\u30b9\u5831\u544a\n        $parts = explode($delimiter, $chunk);\n        $callback($parts, ($processed \/ $total_length) * 100);\n        \n        $processed += strlen($chunk);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\uff08CLI\u74b0\u5883\uff09\nprocess_with_progress($large_string, ',', function($parts, $progress) {\n    \/\/ \u5404\u90e8\u5206\u306e\u51e6\u7406...\n    \n    \/\/ \u9032\u6357\u8868\u793a\n    echo \"\\rProgress: \" . number_format($progress, 1) . \"%\";\n    flush();\n});\n<\/pre>\n\n\n\n<p>Null\u5024\u3084\u7a7a\u6587\u5b57\u306e\u51e6\u7406\u3001\u6587\u5b57\u30b3\u30fc\u30c9\u554f\u984c\u3001\u5927\u304d\u306a\u6587\u5b57\u5217\u306e\u6271\u3044\u306a\u3069\u3001\u3053\u308c\u3089\u306e\u4e00\u822c\u7684\u306a\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306aPHP\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u9069\u5207\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3068\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u306e\u8003\u616e\u306f\u3001\u30d7\u30ed\u30d5\u30a7\u30c3\u30b7\u30e7\u30ca\u30eb\u306a\u958b\u767a\u8005\u306e\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-59\">PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u5225\u306e\u6587\u5b57\u5217\u5206\u5272\u6a5f\u80fd\u306e\u9055\u3044<\/h2>\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u5206\u5272\u6a5f\u80fd\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u4f34\u3063\u3066\u5f90\u3005\u306b\u9032\u5316\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u7279\u306bPHP 7.x\u30b7\u30ea\u30fc\u30ba\u4ee5\u964d\u306f\u5927\u304d\u306a\u6539\u5584\u304c\u3042\u308a\u3001PHP 8.x\u3067\u306f\u3055\u3089\u306b\u5805\u7262\u6027\u304c\u5411\u4e0a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u5404\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u9055\u3044\u3068\u79fb\u884c\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-60\">PHP 7.x\u30688.x\u3067\u306e\u65b0\u6a5f\u80fd\u3068\u6539\u5584\u70b9<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-61\">PHP 7.4\u306e\u91cd\u8981\u306a\u8ffd\u52a0\u6a5f\u80fd<\/h4>\n\n\n\n<p>PHP 7.4\u3067\u6700\u3082\u6ce8\u76ee\u3059\u3079\u304d\u6539\u5584\u70b9\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u3092\u9069\u5207\u306b\u5206\u5272\u3067\u304d\u308b<code>mb_str_split()<\/code>\u95a2\u6570\u306e\u5c0e\u5165\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=\"\">\/\/ PHP 7.4\u4ee5\u964d\u3067\u5229\u7528\u53ef\u80fd\n$japanese = '\u3053\u3093\u306b\u3061\u306f';\n$chars = mb_str_split($japanese); \n\/\/ \u7d50\u679c: ['\u3053', '\u3093', '\u306b', '\u3061', '\u306f']\n<\/pre>\n\n\n\n<p>\u3053\u306e\u95a2\u6570\u304c\u767b\u5834\u3059\u308b\u524d\u306f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u304c\u5fc5\u8981\u3067\u3057\u305f\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=\"\">\/\/ PHP 7.4\u3088\u308a\u524d\u306e\u65b9\u6cd5\nfunction mb_str_split_old($str, $length = 1) {\n    $result = [];\n    $strlen = mb_strlen($str);\n    for ($i = 0; $i &lt; $strlen; $i += $length) {\n        $result[] = mb_substr($str, $i, $length);\n    }\n    return $result;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-62\">PHP 8.0\u3067\u5f37\u5316\u3055\u308c\u305f\u30a8\u30e9\u30fc\u51e6\u7406<\/h4>\n\n\n\n<p>PHP 8.0\u3067\u306f\u3001\u6587\u5b57\u5217\u5206\u5272\u95a2\u9023\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u5927\u304d\u304f\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002\u4ee5\u524d\u306fWarning\uff08\u8b66\u544a\uff09\u3068\u3057\u3066\u6271\u308f\u308c\u3066\u3044\u305f\u554f\u984c\u304c\u3001\u4f8b\u5916\u3068\u3057\u3066\u30b9\u30ed\u30fc\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff1a<\/p>\n\n\n<div id=\"id-6457750d-7d4d-402e-967a-5a8cf833f60b\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u72b6\u6cc1<\/th><th>PHP 7.x<\/th><th>PHP 8.0\u4ee5\u964d<\/th><\/tr><\/thead><tbody><tr><td>\u7a7a\u306e\u30c7\u30ea\u30df\u30bf<\/td><td>Warning + false<\/td><td>ValueError\u4f8b\u5916<\/td><\/tr><tr><td>Null\u5024\u306e\u6587\u5b57\u5217<\/td><td>Warning + false<\/td><td>TypeError\u4f8b\u5916<\/td><\/tr><tr><td>\u4e0d\u6b63\u306a\u30d1\u30e9\u30e1\u30fc\u30bf<\/td><td>Warning + false<\/td><td>ValueError\/TypeError\u4f8b\u5916<\/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=\"\">\/\/ PHP 7.x\n$result = @explode('', 'abc'); \/\/ Warning (\u6291\u5236) + false\n\n\/\/ PHP 8.0\u4ee5\u964d\ntry {\n    $result = explode('', 'abc');\n} catch (ValueError $e) {\n    echo $e-&gt;getMessage(); \/\/ \"explode(): Argument #1 ($separator) cannot be empty\"\n}\n<\/pre>\n\n\n\n<p>\u307e\u305f\u3001PHP 8.0\u3067\u306f\u6587\u5b57\u5217\u64cd\u4f5c\u3092\u7c21\u7d20\u5316\u3059\u308b\u4fbf\u5229\u306a\u95a2\u6570\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\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=\"\">\/\/ PHP 8.0\u4ee5\u964d\nif (str_contains($haystack, $needle)) {\n    \/\/ \u6587\u5b57\u5217\u306b\u7279\u5b9a\u306e\u90e8\u5206\u6587\u5b57\u5217\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u3092\u7c21\u5358\u306b\u78ba\u8a8d\n}\n\n\/\/ PHP 8.0\u306ematch\u5f0f\u3067\u5206\u5c90\u51e6\u7406\u3092\u30b7\u30f3\u30d7\u30eb\u306b\n$parts = match($delimiter) {\n    ',' =&gt; explode(',', $string),\n    ';' =&gt; explode(';', $string),\n    '' =&gt; str_split($string),\n    default =&gt; explode(' ', $string)\n};\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-63\">PHP 8.1\u4ee5\u964d\u306e\u6539\u5584\u70b9<\/h4>\n\n\n\n<p>PHP 8.1\u30688.2\u3067\u306f\u3001\u6587\u5b57\u5217\u5206\u5272\u306b\u76f4\u63a5\u95a2\u308f\u308b\u65b0\u6a5f\u80fd\u306f\u5c11\u306a\u3044\u3082\u306e\u306e\u3001readonly\u4fee\u98fe\u5b50\u3084\u3088\u308a\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u306b\u3088\u308a\u3001\u5927\u304d\u306a\u6587\u5b57\u5217\u3092\u6271\u3046\u30b3\u30fc\u30c9\u304c\u3088\u308a\u5805\u7262\u306b\u306a\u308a\u307e\u3057\u305f\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=\"\">\/\/ PHP 8.1\u4ee5\u964d\nclass TextProcessor {\n    public function __construct(\n        public readonly string $content \/\/ \u5909\u66f4\u3067\u304d\u306a\u3044\u30d7\u30ed\u30d1\u30c6\u30a3\n    ) {}\n    \n    public function splitLines(): array {\n        return explode(\"\\n\", $this-&gt;content);\n    }\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-64\">\u4e0b\u4f4d\u4e92\u63db\u6027\u3092\u4fdd\u3061\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u6700\u65b0\u5316\u3059\u308b\u65b9\u6cd5<\/h3>\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\u306f\u3001\u4e0b\u4f4d\u4e92\u63db\u6027\u3092\u4fdd\u3061\u306a\u304c\u3089\u30b3\u30fc\u30c9\u3092\u6700\u65b0\u5316\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-65\">\u30d0\u30fc\u30b8\u30e7\u30f3\u691c\u51fa\u3068\u6761\u4ef6\u5206\u5c90<\/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=\"\">function is_php8_or_later() {\n    return version_compare(PHP_VERSION, '8.0.0', '&gt;=');\n}\n\nfunction is_php74_or_later() {\n    return version_compare(PHP_VERSION, '7.4.0', '&gt;=');\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nif (is_php74_or_later()) {\n    $chars = mb_str_split($japanese);\n} else {\n    \/\/ 7.4\u672a\u6e80\u7528\u306e\u30dd\u30ea\u30d5\u30a3\u30eb\n    $chars = mb_str_split_polyfill($japanese);\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-66\">\u30dd\u30ea\u30d5\u30a3\u30eb\uff08\u4ee3\u66ff\u5b9f\u88c5\uff09\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p>\u65b0\u3057\u3044\u95a2\u6570\u3092\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3082\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u30dd\u30ea\u30d5\u30a3\u30eb\u3092\u7528\u610f\u3057\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=\"\">\/\/ PHP 7.4\u672a\u6e80\u7528\u306emb_str_split\u30dd\u30ea\u30d5\u30a3\u30eb\nif (!function_exists('mb_str_split')) {\n    function mb_str_split($string, $split_length = 1, $encoding = null) {\n        if ($encoding === null) {\n            $encoding = mb_internal_encoding();\n        }\n        \n        $result = [];\n        $strlen = mb_strlen($string, $encoding);\n        \n        for ($i = 0; $i &lt; $strlen; $i += $split_length) {\n            $result[] = mb_substr($string, $i, $split_length, $encoding);\n        }\n        \n        return $result;\n    }\n}\n\n\/\/ PHP 8.0\u672a\u6e80\u7528\u306estr_contains\u30dd\u30ea\u30d5\u30a3\u30eb\nif (!function_exists('str_contains')) {\n    function str_contains($haystack, $needle) {\n        return $needle !== '' &amp;&amp; strpos($haystack, $needle) !== false;\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-67\">\u4f8b\u5916\u51e6\u7406\u306e\u4e92\u63db\u5bfe\u5fdc<\/h4>\n\n\n\n<p>PHP 8.0\u4ee5\u964d\u306e\u4f8b\u5916\u51e6\u7406\u306b\u5bfe\u5fdc\u3057\u3064\u3064\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u306e\u4e92\u63db\u6027\u3092\u4fdd\u3064\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\u3092\u4f5c\u6210\u3057\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=\"\">function safe_explode($delimiter, $string, $limit = PHP_INT_MAX) {\n    \/\/ PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u308b\u5206\u5c90\n    if (version_compare(PHP_VERSION, '8.0.0', '&gt;=')) {\n        try {\n            return explode($delimiter, $string, $limit);\n        } catch (ValueError|TypeError $e) {\n            error_log(\"String split error: \" . $e-&gt;getMessage());\n            return [];\n        }\n    } else {\n        \/\/ PHP 7.x\u4ee5\u524d\u7528\n        if ($delimiter === '') {\n            trigger_error(\"Empty delimiter\", E_USER_WARNING);\n            return [];\n        }\n        if ($string === null) {\n            $string = '';\n        }\n        return explode($delimiter, (string)$string, $limit);\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-68\">\u79fb\u884c\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<p>PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u3067\u30b3\u30fc\u30c9\u3092\u79fb\u884c\u3059\u308b\u969b\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6bb5\u968e\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1<\/strong>: \u4e00\u5ea6\u306b\u3059\u3079\u3066\u3092\u5909\u66f4\u305b\u305a\u3001\u6bb5\u968e\u7684\u306b\u79fb\u884c\u3059\u308b<\/li>\n\n\n\n<li><strong>\u30dd\u30ea\u30d5\u30a3\u30eb\u306e\u6574\u7406<\/strong>: \u5fc5\u8981\u306a\u30dd\u30ea\u30d5\u30a3\u30eb\u306f\u4e00\u7b87\u6240\u306b\u307e\u3068\u3081\u308b<\/li>\n\n\n\n<li><strong>\u578b\u5ba3\u8a00\u306e\u6d3b\u7528<\/strong>: \u7a4d\u6975\u7684\u306b\u578b\u5ba3\u8a00\u3092\u5c0e\u5165\u3057\u3066\u65e9\u671f\u30a8\u30e9\u30fc\u691c\u51fa\u3092\u884c\u3046<\/li>\n\n\n\n<li><strong>\u30c6\u30b9\u30c8\u306e\u5145\u5b9f<\/strong>: \u7570\u306a\u308bPHP\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306e\u30c6\u30b9\u30c8\u30ab\u30d0\u30ec\u30c3\u30b8\u3092\u78ba\u4fdd\u3059\u308b<\/li>\n\n\n\n<li><strong>NULL\/\u7a7a\u6587\u5b57\u306e\u660e\u793a\u7684\u306a\u51e6\u7406<\/strong>: \u7279\u306b\u3053\u308c\u3089\u306f\u51e6\u7406\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u305f\u3081\u6ce8\u610f<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-69\">\u30e2\u30c0\u30f3\u306aPHP 8.x\u30b9\u30bf\u30a4\u30eb\u3078\u306e\u79fb\u884c<\/h4>\n\n\n\n<p>\u6700\u65b0\u306ePHP 8.x\u306e\u307f\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u306f\u3001\u3088\u308a\u7c21\u6f54\u3067\u8868\u73fe\u529b\u8c4a\u304b\u306a\u30b3\u30fc\u30c9\u304c\u66f8\u3051\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=\"\">\/\/ PHP 8.x\u5411\u3051\u306e\u30e2\u30c0\u30f3\u306a\u5b9f\u88c5\nclass StringSplitter {\n    public function __construct(\n        private readonly string $content\n    ) {}\n    \n    public function split(string $delimiter = ''): array {\n        return match($delimiter) {\n            '' =&gt; mb_str_split($this-&gt;content),\n            default =&gt; explode($delimiter, $this-&gt;content)\n        };\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$splitter = new StringSplitter(\"\u3053\u3093\u306b\u3061\u306f,\u4e16\u754c\");\n$chars = $splitter-&gt;split(); \/\/ \u6587\u5b57\u3054\u3068\u306b\u5206\u5272\n$parts = $splitter-&gt;split(','); \/\/ \u30ab\u30f3\u30de\u3067\u5206\u5272\n<\/pre>\n\n\n\n<p>PHP\u306e\u9032\u5316\u306b\u5408\u308f\u305b\u3066\u30b3\u30fc\u30c9\u3092\u6700\u65b0\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u52b9\u7387\u7684\u306a\u6587\u5b57\u5217\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u7279\u306bPHP 7.4\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u3068\u3001PHP 8.0\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u6539\u5584\u306f\u3001\u65e5\u672c\u8a9e\u3092\u6271\u3046\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3068\u3063\u3066\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u3092\u3082\u305f\u3089\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-70\">\u5b9f\u7528\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u30e6\u30fc\u30b9\u30b1\u30fc\u30b93\u9078<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3067\u6587\u5b57\u5217\u5206\u5272\u306e\u57fa\u672c\u3068\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af\u3092\u5b66\u3093\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u306f\u3069\u306e\u3088\u3046\u306b\u6d3b\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002\u3053\u3053\u3067\u306f\u3001\u65e5\u5e38\u7684\u306a\u958b\u767a\u4f5c\u696d\u3067\u906d\u9047\u3059\u308b3\u3064\u306e\u5b9f\u7528\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u3001\u305d\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-71\">Web\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u5165\u529b\u30c7\u30fc\u30bf\u306e\u9069\u5207\u306a\u51e6\u7406\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u3092\u9069\u5207\u306b\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u8907\u6570\u306e\u5024\u304c\u4e00\u3064\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u542b\u307e\u308c\u308b\u5834\u5408\u3001\u6587\u5b57\u5217\u5206\u5272\u304c\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-72\">\u30bf\u30b0\u5165\u529b\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u304c\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u30bf\u30b0\u3092\u5165\u529b\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u306f\u3001\u3088\u304f\u898b\u304b\u3051\u308b\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=\"\">function validateTags($tagsInput) {\n    if (empty($tagsInput)) {\n        return [];\n    }\n    \n    \/\/ \u30bf\u30b0\u3092\u5206\u5272\n    $tagArray = explode(',', $tagsInput);\n    \n    \/\/ \u5404\u30bf\u30b0\u3092\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\n    $validTags = [];\n    foreach ($tagArray as $tag) {\n        $tag = trim($tag); \/\/ \u7a7a\u767d\u3092\u524a\u9664\n        \n        \/\/ \u7a7a\u30bf\u30b0\u306f\u30b9\u30ad\u30c3\u30d7\n        if (empty($tag)) {\n            continue;\n        }\n        \n        \/\/ \u82f1\u6570\u5b57\u3068\u30cf\u30a4\u30d5\u30f3\u3001\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u306e\u307f\u8a31\u53ef\n        if (preg_match('\/^[a-zA-Z0-9\\-_]+$\/', $tag)) {\n            $validTags[] = $tag;\n        }\n    }\n    \n    return $validTags;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$userInput = \"php, programming, web-dev, php\"; \/\/ \u91cd\u8907\u3042\u308a\u3001\u7a7a\u767d\u3042\u308a\n$tags = validateTags($userInput);\n\/\/ \u7d50\u679c: ['php', 'programming', 'web-dev']\uff08\u91cd\u8907\u306f\u5f8c\u3067\u9664\u53bb\uff09\n$uniqueTags = array_unique($tags);\n<\/pre>\n\n\n\n<p>\u3053\u308c\u306f\u5358\u7d14\u306a\u4f8b\u3067\u3059\u304c\u3001\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3055\u3089\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51e6\u7406\u304c\u5fc5\u8981\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>XSS\u5bfe\u7b56\u3068\u3057\u3066<code>htmlspecialchars()<\/code>\u306b\u3088\u308b\u30a8\u30b9\u30b1\u30fc\u30d7<\/li>\n\n\n\n<li>SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u5bfe\u7b56\u3068\u3057\u3066\u306e\u30d7\u30ea\u30da\u30a2\u30c9\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/li>\n\n\n\n<li>\u4e0d\u6b63\u306a\u5165\u529b\u306b\u5bfe\u3059\u308b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u751f\u6210<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-73\">\u8907\u6570\u884c\u5165\u529b\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u306b\u8907\u6570\u884c\u3067\u5165\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\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=\"\">function processCSVInput($input) {\n    \/\/ \u6539\u884c\u3067\u884c\u306b\u5206\u5272\n    $lines = explode(\"\\n\", $input);\n    $data = [];\n    \n    foreach ($lines as $line) {\n        $line = trim($line);\n        if (empty($line)) continue;\n        \n        \/\/ \u30ab\u30f3\u30de\u3067\u5217\u306b\u5206\u5272\uff08\u5f15\u7528\u7b26\u3067\u56f2\u307e\u308c\u305f\u5024\u3082\u6b63\u3057\u304f\u51e6\u7406\uff09\n        $columns = str_getcsv($line);\n        \n        \/\/ \u5404\u5217\u3092\u30c8\u30ea\u30e0\n        $columns = array_map('trim', $columns);\n        \n        \/\/ \u884c\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\n        $data[] = $columns;\n    }\n    \n    return $data;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$userInput = \"name,email,age\\nJohn Doe,john@example.com,30\\nJane Smith,jane@example.com,25\";\n$parsedData = processCSVInput($userInput);\n\/* \u7d50\u679c:\n[\n    ['name', 'email', 'age'],\n    ['John Doe', 'john@example.com', '30'],\n    ['Jane Smith', 'jane@example.com', '25']\n]\n*\/\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u8907\u6570\u306e\u30c7\u30ea\u30df\u30bf\uff08\u3053\u306e\u5834\u5408\u306f\u6539\u884c\u3068\u30ab\u30f3\u30de\uff09\u3092\u4f7f\u3063\u3066\u968e\u5c64\u7684\u306b\u30c7\u30fc\u30bf\u3092\u5206\u5272\u3059\u308b\u306e\u306f\u3001\u5b9f\u52d9\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-74\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6587\u5b57\u5217\u306e\u52b9\u7387\u7684\u306a\u5206\u5272\u3068\u52a0\u5de5<\/h3>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u306f\u3001\u6b63\u898f\u5316\u306e\u539f\u5247\u306b\u53cd\u3057\u3066\u8907\u6570\u306e\u5024\u3092\u4e00\u3064\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u300c\u30bf\u30b0\u300d\u3084\u300c\u30ab\u30c6\u30b4\u30ea\u300d\u306a\u3069\u306e\u591a\u5bfe\u591a\u95a2\u4fc2\u3067\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u7406\u7531\u304b\u3089\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-75\">\u30bf\u30b0\u30d9\u30fc\u30b9\u306e\u5546\u54c1\u691c\u7d22<\/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=\"\">function getProductsByTags($tags) {\n    $pdo = new PDO('mysql:host=localhost;dbname=shop', 'username', 'password');\n    \n    \/\/ \u30bf\u30b0\u3092\u914d\u5217\u306b\u5909\u63db\n    $tagArray = explode(',', $tags);\n    $tagArray = array_map('trim', $tagArray);\n    \n    \/\/ \u5404\u30bf\u30b0\u3092\u542b\u3080\u5546\u54c1\u3092\u691c\u7d22\n    $products = [];\n    foreach ($tagArray as $tag) {\n        $stmt = $pdo-&gt;prepare(\n            \"SELECT * FROM products WHERE tags LIKE ? OR tags LIKE ? OR tags LIKE ? OR tags = ?\"\n        );\n        $stmt-&gt;execute([\n            $tag . ',%',     \/\/ \u30bf\u30b0\u3067\u59cb\u307e\u308b\n            '%,' . $tag . ',%', \/\/ \u30bf\u30b0\u304c\u4e2d\u9593\u306b\u3042\u308b\n            '%,' . $tag,     \/\/ \u30bf\u30b0\u3067\u7d42\u308f\u308b\n            $tag           \/\/ \u30bf\u30b0\u306e\u307f\n        ]);\n        \n        while ($product = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) {\n            $products[$product['id']] = $product; \/\/ \u91cd\u8907\u3092\u9632\u3050\u305f\u3081\u306bID\u3092\u30ad\u30fc\u306b\n        }\n    }\n    \n    return array_values($products); \/\/ \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u632f\u308a\u76f4\u3057\u3066\u8fd4\u3059\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u5b9f\u88c5\u306b\u306f\u691c\u7d22\u6027\u80fd\u306e\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002\u3088\u308a\u52b9\u7387\u7684\u306a\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u30bf\u30b0\u3092\u5225\u30c6\u30fc\u30d6\u30eb\u3067\u7ba1\u7406\u3059\u308b\u65b9\u6cd5\u3084\u3001\u5168\u6587\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-76\">JSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u51e6\u7406<\/h4>\n\n\n\n<p>\u6700\u8fd1\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u306fJSON\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002MySQL\u306e<code>JSON<\/code>\u578b\u3084\u3001PostgreSQL\u306e<code>JSONB<\/code>\u578b\u3092\u4f7f\u3063\u305f\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\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=\"\">function getUserPreferences($userId) {\n    $pdo = new PDO('mysql:host=localhost;dbname=app', 'username', 'password');\n    \n    $stmt = $pdo-&gt;prepare(\"SELECT preferences FROM users WHERE id = ?\");\n    $stmt-&gt;execute([$userId]);\n    \n    $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC);\n    if (!$row || empty($row['preferences'])) {\n        return []; \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u5024\n    }\n    \n    \/\/ JSON\u6587\u5b57\u5217\u3092\u30c7\u30b3\u30fc\u30c9\n    $preferences = json_decode($row['preferences'], true);\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        error_log('JSON decode error: ' . json_last_error_msg());\n        return [];\n    }\n    \n    return $preferences;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$prefs = getUserPreferences(123);\n$theme = $prefs['theme'] ?? 'light';\n$notifications = $prefs['notifications'] ?? false;\n<\/pre>\n\n\n\n<p>JSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u306f<code>json_decode()<\/code>\u3067\u76f4\u63a5\u914d\u5217\u306b\u5909\u63db\u3067\u304d\u308b\u305f\u3081\u3001<code>explode()<\/code>\u306e\u3088\u3046\u306a\u5358\u7d14\u306a\u5206\u5272\u3088\u308a\u3082\u67d4\u8edf\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002\u7279\u306b\u968e\u5c64\u69cb\u9020\u3092\u6301\u3064\u30c7\u30fc\u30bf\u306e\u5834\u5408\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-77\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u89e3\u6790\u3068\u5fc5\u8981\u30c7\u30fc\u30bf\u306e\u62bd\u51fa\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u5916\u90e8API\u3068\u9023\u643a\u3059\u308b\u969b\u306b\u306f\u3001\u8fd4\u3055\u308c\u308b\u30c7\u30fc\u30bf\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u51e6\u7406\u304c\u983b\u7e41\u306b\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-78\">JSON\u30ec\u30b9\u30dd\u30f3\u30b9\u304b\u3089\u306e\u5024\u62bd\u51fa<\/h4>\n\n\n\n<p>JSON\u5f62\u5f0f\u306eAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u304b\u3089\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u6c4e\u7528\u7684\u306a\u95a2\u6570\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u3087\u3046\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=\"\">function getValueByPath($data, $path) {\n    \/\/ \u30c9\u30c3\u30c8\u533a\u5207\u308a\u306e\u30d1\u30b9\u3092\u914d\u5217\u306b\u5206\u5272\n    $segments = explode('.', $path);\n    $current = $data;\n    \n    foreach ($segments as $segment) {\n        \/\/ \u914d\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u51e6\u7406: items[0]\u5f62\u5f0f\n        if (preg_match('\/^([a-zA-Z0-9_]+)\\[(\\d+)\\]$\/', $segment, $matches)) {\n            $property = $matches[1];\n            $index = (int)$matches[2];\n            \n            if (!isset($current[$property]) || !isset($current[$property][$index])) {\n                return null; \/\/ \u30d1\u30b9\u304c\u5b58\u5728\u3057\u306a\u3044\n            }\n            \n            $current = $current[$property][$index];\n        } else {\n            \/\/ \u901a\u5e38\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30a2\u30af\u30bb\u30b9\n            if (!isset($current[$segment])) {\n                return null; \/\/ \u30d1\u30b9\u304c\u5b58\u5728\u3057\u306a\u3044\n            }\n            \n            $current = $current[$segment];\n        }\n    }\n    \n    return $current;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$apiResponse = '{\n  \"data\": {\n    \"user\": {\n      \"name\": \"John Doe\",\n      \"addresses\": [\n        {\"type\": \"home\", \"city\": \"Tokyo\"},\n        {\"type\": \"work\", \"city\": \"Osaka\"}\n      ]\n    }\n  }\n}';\n\n$data = json_decode($apiResponse, true);\n\n\/\/ \u30c9\u30c3\u30c8\u8a18\u6cd5\u3067\u30cd\u30b9\u30c8\u3055\u308c\u305f\u5024\u306b\u30a2\u30af\u30bb\u30b9\n$userName = getValueByPath($data, 'data.user.name'); \/\/ \"John Doe\"\n$homeCity = getValueByPath($data, 'data.user.addresses[0].city'); \/\/ \"Tokyo\"\n<\/pre>\n\n\n\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001\u30c9\u30c3\u30c8\u8a18\u6cd5\uff08<code>parent.child<\/code>\uff09\u3068\u914d\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08<code>array[0]<\/code>\uff09\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30c7\u30fc\u30bf\u69cb\u9020\u304b\u3089\u5024\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-79\">\u8907\u96d1\u306aAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306eAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u3055\u3089\u306b\u8907\u96d1\u306a\u3053\u3068\u304c\u591a\u304f\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u3084\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3082\u5fc5\u8981\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=\"\">function parseApiResponse($response) {\n    \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u7a7a\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\n    if (empty($response)) {\n        return [\n            'success' =&gt; false,\n            'error' =&gt; 'Empty response',\n            'data' =&gt; null\n        ];\n    }\n    \n    \/\/ JSON\u30c7\u30b3\u30fc\u30c9\n    $data = json_decode($response, true);\n    \n    \/\/ JSON\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        return [\n            'success' =&gt; false,\n            'error' =&gt; 'JSON decode error: ' . json_last_error_msg(),\n            'data' =&gt; null\n        ];\n    }\n    \n    \/\/ API\u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n    if (isset($data['error']) || isset($data['errors'])) {\n        $errorMessage = $data['error'] ?? '';\n        \n        if (empty($errorMessage) &amp;&amp; isset($data['errors']) &amp;&amp; is_array($data['errors'])) {\n            \/\/ \u30a8\u30e9\u30fc\u914d\u5217\u3092\u9023\u7d50\n            $errorMessages = [];\n            foreach ($data['errors'] as $field =&gt; $msgs) {\n                if (is_array($msgs)) {\n                    foreach ($msgs as $msg) {\n                        $errorMessages[] = \"$field: $msg\";\n                    }\n                } else {\n                    $errorMessages[] = \"$field: $msgs\";\n                }\n            }\n            $errorMessage = implode(', ', $errorMessages);\n        }\n        \n        return [\n            'success' =&gt; false,\n            'error' =&gt; $errorMessage ?: 'API returned error',\n            'data' =&gt; $data\n        ];\n    }\n    \n    \/\/ \u6210\u529f\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406\n    $responseData = $data;\n    if (isset($data['data'])) {\n        $responseData = $data['data'];\n    } elseif (isset($data['result'])) {\n        $responseData = $data['result'];\n    } elseif (isset($data['results'])) {\n        $responseData = $data['results'];\n    }\n    \n    return [\n        'success' =&gt; true,\n        'error' =&gt; null,\n        'data' =&gt; $responseData\n    ];\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001\u4e00\u822c\u7684\u306aAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u30d1\u30bf\u30fc\u30f3\u3092\u51e6\u7406\u3057\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u884c\u3044\u307e\u3059\u3002\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3055\u3089\u306b\u7279\u5b9a\u306eAPI\u306b\u5408\u308f\u305b\u305f\u51e6\u7406\u304c\u5fc5\u8981\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306f\u3001\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u3088\u304f\u906d\u9047\u3059\u308b\u6587\u5b57\u5217\u5206\u5272\u306e\u4f8b\u3067\u3059\u3002\u9069\u5207\u306a\u95a2\u6570\u9078\u629e\u3068\u30a8\u30e9\u30fc\u51e6\u7406\u3001\u305d\u3057\u3066\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u5fc3\u304c\u3051\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-80\">\u6587\u5b57\u5217\u5206\u5272\u306e\u5fdc\u7528\uff1a\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u306b\u7d39\u4ecb\u3057\u305f\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u306f\u591a\u304f\u306e\u30b1\u30fc\u30b9\u3067\u5341\u5206\u3067\u3059\u304c\u3001\u3088\u308a\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u6301\u3064\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u306b\u306f\u3001\u6b63\u898f\u8868\u73fe\uff08Regular Expression\uff09\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u5358\u7d14\u306a\u30c7\u30ea\u30df\u30bf\u3067\u306f\u8868\u73fe\u3067\u304d\u306a\u3044\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u57fa\u3065\u3044\u3066\u6587\u5b57\u5217\u3092\u5206\u5272\u30fb\u62bd\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-81\">\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u6301\u3064\u6587\u5b57\u5217\u304b\u3089\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u6301\u3064\u6587\u5b57\u5217\u304b\u3089\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u3092\u62bd\u51fa\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002PHP\u3067\u306f\u4e3b\u306b<code>preg_match()<\/code>\u3001<code>preg_match_all()<\/code>\u3001<code>preg_split()<\/code>\u306a\u3069\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-82\">\u57fa\u672c\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u8981\u7d20<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u3067\u4f7f\u7528\u3055\u308c\u308b\u4e3b\u306a\u8981\u7d20\u3092\u7c21\u5358\u306b\u304a\u3055\u3089\u3044\u3057\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6587\u5b57\u30af\u30e9\u30b9<\/strong>: <code>[a-z]<\/code>\uff08\u5c0f\u6587\u5b57\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\uff09\u3001<code>[0-9]<\/code>\uff08\u6570\u5b57\uff09\u306a\u3069<\/li>\n\n\n\n<li><strong>\u91cf\u6307\u5b9a\u5b50<\/strong>: <code>*<\/code>\uff080\u56de\u4ee5\u4e0a\uff09\u3001<code>+<\/code>\uff081\u56de\u4ee5\u4e0a\uff09\u3001<code>?<\/code>\uff080\u307e\u305f\u306f1\u56de\uff09\u3001<code>{n,m}<\/code>\uff08n\u56de\u4ee5\u4e0am\u56de\u4ee5\u4e0b\uff09<\/li>\n\n\n\n<li><strong>\u30e1\u30bf\u6587\u5b57<\/strong>: <code>.<\/code>\uff08\u4efb\u610f\u306e1\u6587\u5b57\uff09\u3001<code>^<\/code>\uff08\u884c\u982d\uff09\u3001<code>$<\/code>\uff08\u884c\u672b\uff09\u3001<code>\\b<\/code>\uff08\u5358\u8a9e\u5883\u754c\uff09\u306a\u3069<\/li>\n\n\n\n<li><strong>\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9<\/strong>: <code>\\d<\/code>\uff08\u6570\u5b57\uff09\u3001<code>\\w<\/code>\uff08\u5358\u8a9e\u69cb\u6210\u6587\u5b57\uff09\u3001<code>\\s<\/code>\uff08\u7a7a\u767d\u6587\u5b57\uff09\u306a\u3069<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-83\">\u5b9f\u7528\u7684\u306a\u62bd\u51fa\u4f8b<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"i-84\">\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u62bd\u51fa<\/h5>\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 extractEmails($text) {\n    preg_match_all('\/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\/', $text, $matches);\n    return $matches[0]; \/\/ \u30de\u30c3\u30c1\u3057\u305f\u5168\u4f53\u3092\u8fd4\u3059\n}\n\n$content = '\u304a\u554f\u3044\u5408\u308f\u305b\u306f info@example.com \u307e\u305f\u306f support@example.org \u307e\u3067\u304a\u9858\u3044\u3057\u307e\u3059\u3002';\n$emails = extractEmails($content);\n\/\/ \u7d50\u679c: ['info@example.com', 'support@example.org']\n<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"i-85\">\u65e5\u4ed8\u306e\u62bd\u51fa<\/h5>\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 extractDates($text) {\n    \/\/ YYYY-MM-DD \u307e\u305f\u306f YYYY\/MM\/DD \u5f62\u5f0f\u306e\u65e5\u4ed8\u3092\u62bd\u51fa\n    preg_match_all('\/\\d{4}[\\-\\\/]\\d{1,2}[\\-\\\/]\\d{1,2}\/', $text, $matches);\n    return $matches[0];\n}\n\n$content = '\u4f1a\u8b70\u306f2023-05-15\u306b\u958b\u50ac\u3055\u308c\u3001\u6b21\u56de\u306f2023\/06\/30\u306e\u4e88\u5b9a\u3067\u3059\u3002';\n$dates = extractDates($content);\n\/\/ \u7d50\u679c: ['2023-05-15', '2023\/06\/30']\n<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"i-86\">\u30ed\u30b0\u30a8\u30f3\u30c8\u30ea\u306e\u89e3\u6790<\/h5>\n\n\n\n<p>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u89e3\u6790\u3059\u308b\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=\"\">function parseLogEntry($line) {\n    \/\/ [\u65e5\u6642] \u30ec\u30d9\u30eb: \u30e1\u30c3\u30bb\u30fc\u30b8 \u306e\u5f62\u5f0f\n    if (preg_match('\/\\[(.+?)\\]\\s(\\w+):\\s(.+)\/', $line, $matches)) {\n        return [\n            'timestamp' =&gt; $matches[1],\n            'level' =&gt; $matches[2],\n            'message' =&gt; $matches[3]\n        ];\n    }\n    return null;\n}\n\n$logLine = '[2023-05-15 14:30:45] ERROR: Database connection failed';\n$entry = parseLogEntry($logLine);\n\/\/ \u7d50\u679c: ['timestamp' =&gt; '2023-05-15 14:30:45', 'level' =&gt; 'ERROR', 'message' =&gt; 'Database connection failed']\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-87\">\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3092\u6d3b\u7528\u3057\u305f\u67d4\u8edf\u306a\u6587\u5b57\u5217\u5206\u5272<\/h3>\n\n\n\n<p>\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u4e2d\u3067\u62ec\u5f27 <code>()<\/code> \u3067\u56f2\u307e\u308c\u305f\u90e8\u5206\u3067\u3042\u308a\u3001\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u500b\u5225\u306b\u53d6\u5f97\u3067\u304d\u308b\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-88\">\u57fa\u672c\u7684\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/h4>\n\n\n\n<p>\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u3066\u65e5\u4ed8\u3092\u89e3\u6790\u3059\u308b\u4f8b\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=\"\">function parseDate($dateString) {\n    if (preg_match('\/(\\d{4})-(\\d{2})-(\\d{2})\/', $dateString, $matches)) {\n        return [\n            'year' =&gt; $matches[1],  \/\/ 1\u756a\u76ee\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\n            'month' =&gt; $matches[2], \/\/ 2\u756a\u76ee\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\n            'day' =&gt; $matches[3]    \/\/ 3\u756a\u76ee\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\n        ];\n    }\n    return null;\n}\n\n$date = '2023-05-15';\n$parsed = parseDate($date);\n\/\/ \u7d50\u679c: ['year' =&gt; '2023', 'month' =&gt; '05', 'day' =&gt; '15']\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-89\">\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/h4>\n\n\n\n<p>\u6570\u5b57\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3088\u308a\u3082\u3088\u308a\u660e\u78ba\u3067\u8aad\u307f\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306b\u3001\u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3092\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=\"\">function parseDate($dateString) {\n    if (preg_match('\/(?&lt;year&gt;\\d{4})-(?&lt;month&gt;\\d{2})-(?&lt;day&gt;\\d{2})\/', $dateString, $matches)) {\n        return [\n            'year' =&gt; $matches['year'],\n            'month' =&gt; $matches['month'],\n            'day' =&gt; $matches['day']\n        ];\n    }\n    return null;\n}\n\n$date = '2023-05-15';\n$parsed = parseDate($date);\n\/\/ \u7d50\u679c: ['year' =&gt; '2023', 'month' =&gt; '05', 'day' =&gt; '15']\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-90\">\u8907\u96d1\u306a\u69cb\u9020\u306e\u89e3\u6790<\/h4>\n\n\n\n<p>\u3088\u308a\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u89e3\u6790\u3059\u308b\u4f8b\u3068\u3057\u3066\u3001\u5546\u54c1\u60c5\u5831\u3092\u30d1\u30a4\u30d7\u533a\u5207\u308a\u3067\u8868\u73fe\u3057\u305f\u6587\u5b57\u5217\u3092\u89e3\u6790\u3057\u3066\u307f\u307e\u3057\u3087\u3046\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=\"\">function parseProductInfo($productString) {\n    \/\/ \u540d\u524d|\u4fa1\u683c|\u30ab\u30c6\u30b4\u30ea|\u30bf\u30b01,\u30bf\u30b02,...\n    $pattern = '\/(?&lt;name&gt;[^\\|]+)\\|(?&lt;price&gt;\\d+(?:\\.\\d{2})?)(?:\\|(?&lt;category&gt;[^\\|]+))?(?:\\|(?&lt;tags&gt;.+))?\/';\n    \n    if (preg_match($pattern, $productString, $matches)) {\n        $result = [\n            'name' =&gt; trim($matches['name']),\n            'price' =&gt; (float)$matches['price'],\n            'category' =&gt; isset($matches['category']) ? trim($matches['category']) : null,\n            'tags' =&gt; []\n        ];\n        \n        \/\/ \u30bf\u30b0\u304c\u3042\u308b\u5834\u5408\u306f\u5206\u5272\n        if (isset($matches['tags'])) {\n            $result['tags'] = array_map('trim', explode(',', $matches['tags']));\n        }\n        \n        return $result;\n    }\n    \n    return null;\n}\n\n$productString = '\u30ef\u30a4\u30e4\u30ec\u30b9\u30d8\u30c3\u30c9\u30d5\u30a9\u30f3|9980|\u96fb\u5b50\u6a5f\u5668|bluetooth,\u30ef\u30a4\u30e4\u30ec\u30b9,\u30aa\u30fc\u30c7\u30a3\u30aa';\n$product = parseProductInfo($productString);\n\/* \u7d50\u679c:\n[\n    'name' =&gt; '\u30ef\u30a4\u30e4\u30ec\u30b9\u30d8\u30c3\u30c9\u30d5\u30a9\u30f3',\n    'price' =&gt; 9980,\n    'category' =&gt; '\u96fb\u5b50\u6a5f\u5668',\n    'tags' =&gt; ['bluetooth', '\u30ef\u30a4\u30e4\u30ec\u30b9', '\u30aa\u30fc\u30c7\u30a3\u30aa']\n]\n*\/\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-91\">\u30c7\u30ea\u30df\u30bf\u3092\u4fdd\u6301\u3057\u305f\u5206\u5272<\/h4>\n\n\n\n<p>\u901a\u5e38\u3001<code>preg_split()<\/code>\u306f\u30c7\u30ea\u30df\u30bf\u3092\u6368\u3066\u307e\u3059\u304c\u3001<code>PREG_SPLIT_DELIM_CAPTURE<\/code>\u30d5\u30e9\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30ea\u30df\u30bf\u3082\u30ad\u30e3\u30d7\u30c1\u30e3\u3057\u3066\u7d50\u679c\u306b\u542b\u3081\u308b\u3053\u3068\u304c\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=\"\">function splitWithDelimiters($string, $pattern) {\n    \/\/ \u30d1\u30bf\u30fc\u30f3\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\u3067\u56f2\u3080\n    $pattern = '\/' . str_replace('\/', '\\\/', $pattern) . '\/';\n    \n    \/\/ PREG_SPLIT_DELIM_CAPTURE\u30d5\u30e9\u30b0\u3092\u4f7f\u7528\n    $parts = preg_split($pattern, $string, -1, PREG_SPLIT_DELIM_CAPTURE);\n    return $parts;\n}\n\n$text = '\u3053\u308c\u306f&lt;b&gt;\u592a\u5b57&lt;\/b&gt;\u3068&lt;i&gt;\u659c\u4f53&lt;\/i&gt;\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u3059';\n$parts = splitWithDelimiters($text, '&lt;[^&gt;]+&gt;');\n\/\/ \u7d50\u679c: ['\u3053\u308c\u306f', '&lt;b&gt;', '\u592a\u5b57', '&lt;\/b&gt;', '\u3068', '&lt;i&gt;', '\u659c\u4f53', '&lt;\/i&gt;', '\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u3059']\n<\/pre>\n\n\n\n<p>\u3053\u308c\u306f\u3001HTML\u306e\u3088\u3046\u306a\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u30c6\u30ad\u30b9\u30c8\u3092\u89e3\u6790\u3059\u308b\u969b\u306b\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-92\">\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u30b3\u30c4<\/h3>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306f\u5f37\u529b\u3067\u3059\u304c\u3001\u9069\u5207\u306b\u4f7f\u7528\u3057\u306a\u3044\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u6700\u9069\u5316\u306e\u30b3\u30c4\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-93\">1. \u30a2\u30f3\u30ab\u30fc\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n\n\n\n<p>\u30d1\u30bf\u30fc\u30f3\u306e\u5148\u982d\u307e\u305f\u306f\u672b\u5c3e\u3092\u56fa\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30c3\u30c1\u30f3\u30b0\u30d7\u30ed\u30bb\u30b9\u3092\u5927\u5e45\u306b\u9ad8\u901f\u5316\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=\"\">\/\/ \u30a2\u30f3\u30ab\u30fc\u306a\u3057\uff08\u9045\u3044\uff09- \u6587\u5b57\u5217\u5168\u4f53\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\n$slowPattern = '\/username\/';\n\n\/\/ \u30a2\u30f3\u30ab\u30fc\u4f7f\u7528\uff08\u901f\u3044\uff09- \u5148\u982d\u3068\u672b\u5c3e\u304c\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u3059\u3050\u306b\u5224\u5b9a\u3067\u304d\u308b\n$fastPattern = '\/^username$\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-94\">2. \u4e0d\u8981\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u3092\u907f\u3051\u308b<\/h4>\n\n\n\n<p>\u5fc5\u8981\u306e\u306a\u3044\u90e8\u5206\u306f\u30ad\u30e3\u30d7\u30c1\u30e3\u3057\u306a\u3044\u3053\u3068\u3067\u3001\u51e6\u7406\u901f\u5ea6\u3068\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6539\u5584\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=\"\">\/\/ \u4e0d\u8981\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\uff08\u9045\u3044\uff09\n$slowPattern = '\/(https?:\\\/\\\/)?(www\\.)?([a-z0-9.-]+\\.com)\/';\n\n\/\/ \u5fc5\u8981\u306a\u30ad\u30e3\u30d7\u30c1\u30e3\u306e\u307f\uff08\u901f\u3044\uff09- (?:...)\u306f\u975e\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7\n$fastPattern = '\/(?:https?:\\\/\\\/)?(?:www\\.)?([a-z0-9.-]+\\.com)\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-95\">3. \u5177\u4f53\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n\n\n\n<p>\u3067\u304d\u308b\u3060\u3051\u5177\u4f53\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30c3\u30c1\u30f3\u30b0\u51e6\u7406\u3092\u9ad8\u901f\u5316\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=\"\">\/\/ \u4e00\u822c\u7684\u3059\u304e\u308b\u30d1\u30bf\u30fc\u30f3\uff08\u9045\u3044\uff09\n$slowPattern = '\/.*test.*\/';\n\n\/\/ \u3088\u308a\u5177\u4f53\u7684\u306a\u30d1\u30bf\u30fc\u30f3\uff08\u901f\u3044\uff09\n$fastPattern = '\/[a-zA-Z0-9_]*test[a-zA-Z0-9_]*\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-96\">4. \u6b63\u898f\u8868\u73fe\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b<\/h4>\n\n\n\n<p>\u7e70\u308a\u8fd4\u3057\u4f7f\u7528\u3059\u308b\u6b63\u898f\u8868\u73fe\u306f\u30eb\u30fc\u30d7\u5916\u3067\u5b9a\u7fa9\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\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=\"\">\/\/ \u975e\u52b9\u7387\u7684\u306a\u4f8b\uff08\u30eb\u30fc\u30d7\u5185\u3067\u30d1\u30bf\u30fc\u30f3\u3092\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\uff09\nfunction parseLines_slow($lines) {\n    $results = [];\n    foreach ($lines as $line) {\n        \/\/ \u30eb\u30fc\u30d7\u3054\u3068\u306b\u6b63\u898f\u8868\u73fe\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u3044\u308b\n        if (preg_match('\/^(\\d{4})-(\\d{2})-(\\d{2}):\\s(.+)$\/', $line, $matches)) {\n            $results[] = [\n                'date' =&gt; \"{$matches[1]}-{$matches[2]}-{$matches[3]}\",\n                'message' =&gt; $matches[4]\n            ];\n        }\n    }\n    return $results;\n}\n\n\/\/ \u52b9\u7387\u7684\u306a\u4f8b\uff08\u30d1\u30bf\u30fc\u30f3\u3092\u30eb\u30fc\u30d7\u306e\u5916\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\uff09\nfunction parseLines_fast($lines) {\n    $pattern = '\/^(\\d{4})-(\\d{2})-(\\d{2}):\\s(.+)$\/';\n    $results = [];\n    foreach ($lines as $line) {\n        if (preg_match($pattern, $line, $matches)) {\n            $results[] = [\n                'date' =&gt; \"{$matches[1]}-{$matches[2]}-{$matches[3]}\",\n                'message' =&gt; $matches[4]\n            ];\n        }\n    }\n    return $results;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-97\">5. \u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u3092\u907f\u3051\u308b<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u30a8\u30f3\u30b8\u30f3\u306e\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u306f\u3001\u5927\u91cf\u306e\u30c6\u30ad\u30b9\u30c8\u3084\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u51e6\u7406\u6642\u9593\u304c\u6307\u6570\u95a2\u6570\u7684\u306b\u5897\u52a0\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\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=\"\">\/\/ \u6f5c\u5728\u7684\u306a\u30d0\u30c3\u30af\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0\u554f\u984c\uff08\u9045\u3044\uff09\n$problematicPattern = '\/(a+)+b\/'; \/\/ 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaac' \u306e\u3088\u3046\u306a\u5165\u529b\u3067\u554f\u984c\u304c\u767a\u751f\n\n\/\/ \u3088\u308a\u52b9\u7387\u7684\u306a\u30d1\u30bf\u30fc\u30f3\uff08\u901f\u3044\uff09\n$efficientPattern = '\/a+b\/';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-98\">6. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6e2c\u5b9a<\/h4>\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6e2c\u5b9a\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306a\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u95a2\u6570\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=\"\">function benchmarkRegex($pattern, $subject, $iterations = 1000) {\n    $start = microtime(true);\n    \n    for ($i = 0; $i &lt; $iterations; $i++) {\n        preg_match($pattern, $subject, $matches);\n    }\n    \n    $end = microtime(true);\n    $time = $end - $start;\n    \n    return [\n        'pattern' =&gt; $pattern,\n        'time' =&gt; $time,\n        'iterations' =&gt; $iterations,\n        'avg_time' =&gt; $time \/ $iterations\n    ];\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$result1 = benchmarkRegex('\/^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$\/', 'test@example.com');\n$result2 = benchmarkRegex('\/^.+@.+\\..+$\/', 'test@example.com');\n\necho \"\u5177\u4f53\u7684\u306a\u30d1\u30bf\u30fc\u30f3: {$result1['avg_time']} \u79d2\/\u30a4\u30c6\u30ec\u30fc\u30b7\u30e7\u30f3\\n\";\necho \"\u4e00\u822c\u7684\u306a\u30d1\u30bf\u30fc\u30f3: {$result2['avg_time']} \u79d2\/\u30a4\u30c6\u30ec\u30fc\u30b7\u30e7\u30f3\\n\";\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-99\">\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u5224\u65ad<\/h4>\n\n\n\n<p>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u306e\u3088\u3046\u306a\u5b9f\u7528\u7684\u306a\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u7cbe\u5ea6\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u53d6\u308b\u3053\u3068\u304c\u91cd\u8981\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=\"\">\/\/ \u5b8c\u5168\u3067\u53b3\u5bc6\u306a\u691c\u8a3c\uff08RFC\u6e96\u62e0\u3060\u304c\u975e\u5e38\u306b\u8907\u96d1\u3067\u9045\u3044\uff09\n$complexPattern = '\/^(?:[a-z0-9!#$%&amp;\\'*+\\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;\\'*+\\\/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$\/i';\n\n\/\/ \u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\uff08100%\u6b63\u78ba\u3067\u306f\u306a\u3044\u304c\u9ad8\u901f\uff09\n$simplePattern = '\/^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$\/i';\n\n\/\/ \u30d0\u30e9\u30f3\u30b9\u306e\u53d6\u308c\u305f\u30d1\u30bf\u30fc\u30f3\uff08\u9ad8\u3044\u7cbe\u5ea6\u3068\u59a5\u5f53\u306a\u901f\u5ea6\uff09\n$balancedPattern = '\/^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,63}$\/i';\n<\/pre>\n\n\n\n<p>\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30d0\u30e9\u30f3\u30b9\u306e\u53d6\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u3092\u9078\u629e\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8ffd\u52a0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p>\u6b63\u898f\u8868\u73fe\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u6587\u5b57\u5217\u5206\u5272\u6280\u8853\u3092\u7fd2\u5f97\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u30c6\u30ad\u30b9\u30c8\u51e6\u7406\u3092\u3088\u308a\u52b9\u679c\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3084\u4fdd\u5b88\u6027\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u5e38\u306b\u8003\u616e\u3057\u3001\u9069\u5207\u306a\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u7279\u306b\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u3092\u6d3b\u7528\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5fdc\u7b54\u6027\u3092\u7dad\u6301\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-100\">\u307e\u3068\u3081\uff1a\u72b6\u6cc1\u306b\u5fdc\u3058\u305f\u6700\u9069\u306a\u6587\u5b57\u5217\u5206\u5272\u624b\u6cd5\u306e\u9078\u3073\u65b9<\/h2>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001PHP\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u6587\u5b57\u5217\u5206\u5272\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u521d\u5fc3\u8005\u304b\u3089\u4e0a\u7d1a\u8005\u307e\u3067\u3001\u3042\u3089\u3086\u308b\u30ec\u30d9\u30eb\u306e\u958b\u767a\u8005\u304c\u5b9f\u52d9\u3067\u76f4\u9762\u3059\u308b\u6587\u5b57\u5217\u5206\u5272\u306e\u8ab2\u984c\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u3001\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u3092\u4f53\u7cfb\u7684\u306b\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u6700\u5f8c\u306b\u3001\u3053\u308c\u307e\u3067\u306e\u5185\u5bb9\u3092\u6574\u7406\u3057\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u305f\u6700\u9069\u306a\u624b\u6cd5\u306e\u9078\u3073\u65b9\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-101\">\u30b7\u30ca\u30ea\u30aa\u5225\u304a\u3059\u3059\u3081\u5206\u5272\u95a2\u6570\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30c1\u30fc\u30c8\u30b7\u30fc\u30c8\u3092\u53c2\u8003\u306b\u3001\u3042\u306a\u305f\u306e\u72b6\u6cc1\u306b\u6700\u9069\u306a\u6587\u5b57\u5217\u5206\u5272\u95a2\u6570\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-102\">\u57fa\u672c\u7684\u306a\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n<div id=\"id-ebe533b8-6444-4d01-8c34-178c8b751360\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b7\u30ca\u30ea\u30aa<\/th><th>\u304a\u3059\u3059\u3081\u95a2\u6570<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u5358\u4e00\u306e\u533a\u5207\u308a\u6587\u5b57\u306b\u3088\u308b\u5206\u5272&lt;br&gt;\uff08\u30ab\u30f3\u30de\u533a\u5207\u308a\u30ea\u30b9\u30c8\u306a\u3069\uff09<\/td><td><code>explode()<\/code><\/td><td>\u30b7\u30f3\u30d7\u30eb\u3067\u9ad8\u901f\u3001\u6700\u3082\u4e00\u822c\u7684\u306a\u30b1\u30fc\u30b9\u306b\u6700\u9069<\/td><\/tr><tr><td>\u56fa\u5b9a\u9577\u3067\u6587\u5b57\u5217\u3092\u5206\u5272&lt;br&gt;\uff08\u6587\u5b57\u3054\u3068\u30012\u6587\u5b57\u3054\u3068\u306a\u3069\uff09<\/td><td><code>str_split()<\/code><\/td><td>\u56fa\u5b9a\u9577\u306e\u5206\u5272\u306b\u7279\u5316\u3057\u3066\u304a\u308a\u3001\u30b7\u30f3\u30d7\u30eb\u3067\u52b9\u7387\u7684<\/td><\/tr><tr><td>\u8907\u6570\u306e\u533a\u5207\u308a\u6587\u5b57\u306b\u3088\u308b\u5206\u5272<\/td><td><code>preg_split()<\/code><\/td><td>\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u8907\u6570\u306e\u533a\u5207\u308a\u6587\u5b57\u3092\u6307\u5b9a\u3067\u304d\u308b<\/td><\/tr><tr><td>\u7a7a\u306e\u8981\u7d20\u3092\u9664\u5916\u3057\u305f\u5206\u5272<\/td><td><code>explode()<\/code> + <code>array_filter()<\/code><\/td><td>explode\u306e\u7d50\u679c\u304b\u3089\u7a7a\u8981\u7d20\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3067\u304d\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-103\">\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\uff08\u65e5\u672c\u8a9e\u306a\u3069\uff09\u3092\u542b\u3080\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n<div id=\"id-16cf7b6b-e477-4cab-9294-4e04b5b73d10\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b7\u30ca\u30ea\u30aa<\/th><th>\u304a\u3059\u3059\u3081\u95a2\u6570<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u65e5\u672c\u8a9e\u306a\u3069\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u542b\u3080&lt;br&gt;\u6587\u5b57\u5217\u306e\u5206\u5272<\/td><td><code>mb_split()<\/code><\/td><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u5bfe\u5fdc\u3057\u305f\u6b63\u898f\u8868\u73fe\u30d9\u30fc\u30b9\u306e\u5206\u5272<\/td><\/tr><tr><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272&lt;br&gt;\uff08PHP 7.4\u4ee5\u964d\uff09<\/td><td><code>mb_str_split()<\/code><\/td><td>PHP 7.4\u3067\u8ffd\u52a0\u3055\u308c\u305f\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306estr_split()\u7248<\/td><\/tr><tr><td>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u30921\u6587\u5b57\u305a\u3064\u5206\u5272&lt;br&gt;\uff08PHP 7.4\u672a\u6e80\uff09<\/td><td>\u30ab\u30b9\u30bf\u30e0\u95a2\u6570<\/td><td>mb_substr()\u3068\u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u3066\u5b9f\u88c5<\/td><\/tr><tr><td>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u5909\u63db\u3068\u5206\u5272<\/td><td><code>mb_convert_encoding()<\/code> + <code>mb_split()<\/code><\/td><td>\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u9055\u3044\u306b\u3088\u308b\u554f\u984c\u3092\u89e3\u6c7a\u3067\u304d\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-104\">\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u542b\u3080\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n<div id=\"id-97fcac8b-3f55-44ba-a4f7-414f4f08c656\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b7\u30ca\u30ea\u30aa<\/th><th>\u304a\u3059\u3059\u3081\u95a2\u6570<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u7279\u5b9a\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u62bd\u51fa&lt;br&gt;\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306a\u3069\uff09<\/td><td><code>preg_match_all()<\/code><\/td><td>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u90e8\u5206\u3092\u62bd\u51fa\u3067\u304d\u308b<\/td><\/tr><tr><td>HTML\u30bf\u30b0\u306e\u51e6\u7406<\/td><td><code>preg_split()<\/code> + <code>PREG_SPLIT_DELIM_CAPTURE<\/code><\/td><td>\u30c7\u30ea\u30df\u30bf\uff08\u30bf\u30b0\uff09\u3082\u4fdd\u6301\u3057\u306a\u304c\u3089\u5206\u5272\u3067\u304d\u308b<\/td><\/tr><tr><td>\u69cb\u9020\u5316\u30c7\u30fc\u30bf\u306e\u62bd\u51fa<\/td><td><code>preg_match()<\/code> + \u540d\u524d\u4ed8\u304d\u30ad\u30e3\u30d7\u30c1\u30e3\u30b0\u30eb\u30fc\u30d7<\/td><td>\u8907\u96d1\u306a\u69cb\u9020\u304b\u3089\u306e\u62bd\u51fa\u3068\u540d\u524d\u306b\u3088\u308b\u30a2\u30af\u30bb\u30b9\u304c\u53ef\u80fd<\/td><\/tr><tr><td>JSON\u30c7\u30fc\u30bf\u306e\u89e3\u6790<\/td><td><code>json_decode()<\/code><\/td><td>JSON\u6587\u5b57\u5217\u3092\u76f4\u63a5PHP\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u914d\u5217\u306b\u5909\u63db<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-105\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u91cd\u8981\u306a\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n<div id=\"id-525fc24f-3cf9-4325-a150-7a2db64e206d\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b7\u30ca\u30ea\u30aa<\/th><th>\u304a\u3059\u3059\u3081\u95a2\u6570<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u5927\u91cf\u306e\u6587\u5b57\u5217\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406<\/td><td><code>strtok()<\/code><\/td><td>\u6700\u5c0f\u9650\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3067\u53cd\u5fa9\u51e6\u7406\u304c\u53ef\u80fd<\/td><\/tr><tr><td>\u983b\u7e41\u306b\u5b9f\u884c\u3055\u308c\u308b\u5206\u5272\u51e6\u7406<\/td><td><code>explode()<\/code> + \u30ad\u30e3\u30c3\u30b7\u30e5<\/td><td>\u6700\u3082\u52b9\u7387\u7684\u306a\u95a2\u6570\u3092\u4f7f\u3044\u3001\u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5<\/td><\/tr><tr><td>\u6700\u5927\u9650\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u5fc5\u8981\u306a\u5358\u7d14\u306a\u5206\u5272<\/td><td><code>strpos()<\/code> + <code>substr()<\/code><\/td><td>\u57fa\u672c\u7684\u306a\u6587\u5b57\u5217\u95a2\u6570\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u6700\u901f\u306e\u5834\u5408\u304c\u3042\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-106\">\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u3092\u6271\u3046\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n<div id=\"id-4a6f71e2-038a-46cc-8ba7-f5facbd28dbc\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30b7\u30ca\u30ea\u30aa<\/th><th>\u304a\u3059\u3059\u3081\u95a2\u6570<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u884c\u3054\u3068\u306b\u51e6\u7406<\/td><td><code>fgets()<\/code> + <code>explode()<\/code><\/td><td>\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u826f\u3044\u30b9\u30c8\u30ea\u30fc\u30e0\u8aad\u307f\u8fbc\u307f\u3068\u884c\u3054\u3068\u306e\u5206\u5272<\/td><\/tr><tr><td>\u5de8\u5927\u306a\u6587\u5b57\u5217\u3092\u90e8\u5206\u7684\u306b\u51e6\u7406<\/td><td><code>substr()<\/code> + <code>explode()<\/code><\/td><td>\u6587\u5b57\u5217\u306e\u4e00\u90e8\u3060\u3051\u3092\u5207\u308a\u51fa\u3057\u3066\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6291\u5236<\/td><\/tr><tr><td>\u975e\u540c\u671f\u51e6\u7406\u306b\u3088\u308b\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u5206\u5272<\/td><td>\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3<\/td><td>PHP 5.5\u4ee5\u964d\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3092\u4f7f\u3063\u305f\u9045\u5ef6\u8a55\u4fa1<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"i-107\">\u9078\u629e\u306e\u610f\u601d\u6c7a\u5b9a\u30d5\u30ed\u30fc<\/h4>\n\n\n\n<p>\u6587\u5b57\u5217\u5206\u5272\u624b\u6cd5\u3092\u9078\u3076\u969b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u610f\u601d\u6c7a\u5b9a\u30d5\u30ed\u30fc\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5206\u5272\u30d1\u30bf\u30fc\u30f3\u306e\u8907\u96d1\u3055\u3092\u8a55\u4fa1\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u5358\u7d14\u306a\u30c7\u30ea\u30df\u30bf\u306b\u3088\u308b\u5206\u5272 \u2192 <code>explode()<\/code><\/li>\n\n\n\n<li>\u56fa\u5b9a\u9577\u306b\u3088\u308b\u5206\u5272 \u2192 <code>str_split()<\/code><\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u308b\u5206\u5272 \u2192 \u6b63\u898f\u8868\u73fe\u95a2\u6570<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u8003\u616e\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>ASCII\u6587\u5b57\u306e\u307f \u2192 \u6a19\u6e96\u95a2\u6570<\/li>\n\n\n\n<li>\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u3092\u542b\u3080 \u2192 <code>mb_*<\/code>\u7cfb\u95a2\u6570<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30c7\u30fc\u30bf\u30b5\u30a4\u30ba\u3092\u8a55\u4fa1\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u5c0f\uff5e\u4e2d\u898f\u6a21\u30c7\u30fc\u30bf \u2192 \u30e1\u30e2\u30ea\u5185\u51e6\u7406<\/li>\n\n\n\n<li>\u5927\u898f\u6a21\u30c7\u30fc\u30bf \u2192 \u30b9\u30c8\u30ea\u30fc\u30e0\u51e6\u7406\u3084\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8981\u4ef6\u3092\u691c\u8a0e\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u9ad8\u983b\u5ea6\u5b9f\u884c \u2192 \u6700\u9069\u5316\u3068\u30ad\u30e3\u30c3\u30b7\u30e5<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u5236\u7d04 \u2192 \u90e8\u5206\u51e6\u7406\u3084\u9045\u5ef6\u8a55\u4fa1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u4fdd\u5b88\u6027\u3068\u53ef\u8aad\u6027\u3092\u8003\u616e\u3059\u308b<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u30c1\u30fc\u30e0\u958b\u767a \u2192 \u30b7\u30f3\u30d7\u30eb\u3067\u660e\u78ba\u306a\u30b3\u30fc\u30c9<\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u30ed\u30b8\u30c3\u30af \u2192 \u9069\u5207\u306a\u30b3\u30e1\u30f3\u30c8\u3068\u6587\u66f8\u5316<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u3069\u306e\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3067\u3082\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u53d6\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u904e\u5ea6\u306b\u8907\u96d1\u306a\u89e3\u6c7a\u7b56\u306f\u907f\u3051\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u6bb5\u968e\u7684\u306b\u6700\u9069\u5316\u3057\u3066\u3044\u304f\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-108\">\u3055\u3089\u306a\u308b\u30b9\u30ad\u30eb\u30a2\u30c3\u30d7\u306e\u305f\u3081\u306e\u53c2\u8003\u30ea\u30bd\u30fc\u30b9<\/h3>\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u51e6\u7406\u30b9\u30ad\u30eb\u3092\u3055\u3089\u306b\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u53c2\u8003\u30ea\u30bd\u30fc\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-109\">\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/ref.strings.php\">PHP: \u6587\u5b57\u5217\u95a2\u6570 \u2013 Manual<\/a> \u2013 PHP\u306e\u6a19\u6e96\u6587\u5b57\u5217\u95a2\u6570\u306b\u95a2\u3059\u308b\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/li>\n\n\n\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/ref.pcre.php\">PHP: \u6b63\u898f\u8868\u73fe\u95a2\u6570 (PCRE) \u2013 Manual<\/a> \u2013 PHP\u306e\u6b63\u898f\u8868\u73fe\u95a2\u6570\u306b\u95a2\u3059\u308b\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/li>\n\n\n\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/ref.mbstring.php\">PHP: \u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u95a2\u6570 \u2013 Manual<\/a> \u2013 PHP\u306e\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5217\u95a2\u6570\u306b\u95a2\u3059\u308b\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-110\">\u304a\u3059\u3059\u3081\u306e\u66f8\u7c4d<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u300eModern PHP: New Features and Good Practices\u300fby Josh Lockhart \u2013 \u30e2\u30c0\u30f3\u306aPHP\u306e\u66f8\u304d\u65b9\u3084\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/li>\n\n\n\n<li>\u300ePHP 7 Programming Cookbook\u300fby Doug Bierer \u2013 \u5b9f\u8df5\u7684\u306aPHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u30ec\u30b7\u30d4\u96c6<\/li>\n\n\n\n<li>\u300e\u6b63\u898f\u8868\u73fe\u30dd\u30b1\u30c3\u30c8\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u300fby \u5bae\u5d0e \u5eb7\u592a\u90ce\u30fb\u4ed6 \u2013 \u6b63\u898f\u8868\u73fe\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-111\">\u30aa\u30f3\u30e9\u30a4\u30f3\u30ea\u30bd\u30fc\u30b9<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/phptherightway.com\/\">PHP: The Right Way<\/a> \u2013 PHP\u306e\u73fe\u4ee3\u7684\u306a\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u5b66\u3079\u308b\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8<\/li>\n\n\n\n<li><a href=\"https:\/\/regex101.com\/\">Regex101<\/a> \u2013 \u6b63\u898f\u8868\u73fe\u306e\u30c6\u30b9\u30c8\u3068\u30c7\u30d0\u30c3\u30b0\u306e\u305f\u3081\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb<\/li>\n\n\n\n<li><a href=\"https:\/\/3v4l.org\/\">3v4l.org<\/a> \u2013 \u7570\u306a\u308bPHP\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u30fb\u6bd4\u8f03\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-112\">\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/voku\/Stringy\">Stringy<\/a> \u2013 \u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u6587\u5b57\u5217\u64cd\u4f5c\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/symfony\/string\">symfony\/string<\/a> \u2013 Symfony\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u6587\u5b57\u5217\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u6d3b\u7528\u3057\u3066\u3001\u6587\u5b57\u5217\u51e6\u7406\u306b\u95a2\u3059\u308b\u77e5\u8b58\u3092\u3055\u3089\u306b\u6df1\u3081\u3001\u3088\u308a\u52b9\u7387\u7684\u3067\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u3088\u3046\u52aa\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\">\n\n\n\n<p>PHP\u306e\u6587\u5b57\u5217\u5206\u5272\u306f\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u304a\u3051\u308b\u57fa\u672c\u7684\u304b\u3064\u91cd\u8981\u306a\u30b9\u30ad\u30eb\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u6280\u8853\u3092\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u9069\u7528\u3057\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u6700\u9069\u306a\u624b\u6cd5\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308c\u3070\u3001\u3088\u308a\u8cea\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002\u5e38\u306b\u5b66\u3073\u7d9a\u3051\u3001\u65b0\u3057\u3044\u30c6\u30af\u30cb\u30c3\u30af\u3084\u6539\u5584\u70b9\u3092\u63a2\u6c42\u3059\u308b\u59ff\u52e2\u304c\u3001\u512a\u308c\u305f\u958b\u767a\u8005\u3078\u306e\u9053\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/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,63],"tags":[],"class_list":{"0":"post-3775","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"category-php-syntax","8":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3775","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=3775"}],"version-history":[{"count":1,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3775\/revisions"}],"predecessor-version":[{"id":3776,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3775\/revisions\/3776"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}