{"id":46969,"date":"2024-12-02T13:17:54","date_gmt":"2024-12-02T05:17:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/46969\/"},"modified":"2024-12-02T13:17:54","modified_gmt":"2024-12-02T05:17:54","slug":"php-%e5%87%bd%e6%95%b0%e4%ba%8b%e4%bb%b6%e5%a4%84%e7%90%86%e6%8a%80%e6%9c%af%e6%98%af%e5%90%a6%e5%bd%b1%e5%93%8d%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e7%9a%84%e6%80%a7%e8%83%bd%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/46969\/","title":{"rendered":"PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f<\/h1>\n<p>\u6b22\u8fce\u5404\u4f4d\u5c0f\u4f19\u4f34\u6765\u5230\u7c73\u4e91\uff0c\u76f8\u805a\u4e8e\u6b64\u90fd\u662f\u7f18\u54c8\u54c8\u54c8\uff01\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aPHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f\u300b<\/span>\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\uff0c\u5982\u679c\u4f60\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u77e5\u8bc6\u975e\u5e38\u611f\u5174\u8da3\u6216\u8005\u6b63\u5728\u81ea\u5b66\uff0c\u90fd\u53ef\u4ee5\u5173\u6ce8\u6211\uff0c\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u6587\u7ae0\uff01\u5f53\u7136\uff0c\u6709\u4ec0\u4e48\u5efa\u8bae\u4e5f\u6b22\u8fce\u5728\u8bc4\u8bba\u7559\u8a00\u63d0\u51fa\uff01\u4e00\u8d77\u5b66\u4e60\uff01<\/p>\n<p>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406 (FEH) \u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6280\u672f\uff0c\u5141\u8bb8\u5904\u7406\u5404\u79cd\u4e8b\u4ef6\uff0c\u4f46\u5b83\u53ef\u80fd\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u6027\u80fd\uff1aFEH \u521b\u5efa\u4e00\u4e2a\u4ee3\u7406\u51fd\u6570\uff0c\u5bfc\u81f4\u5f00\u9500\uff0c\u5c24\u5176\u662f\u5728\u9891\u7e41\u8c03\u7528\u6216\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u3002\u5f71\u54cd\u56e0\u7d20\u5305\u62ec\u8c03\u7528\u9891\u7387\u3001\u51fd\u6570\u590d\u6742\u6027\u548c\u6570\u636e\u5927\u5c0f\uff0c\u4f8b\u5982\uff1a\u68c0\u6d4b\u5b57\u7b26\u4e32\u4e2d\u5355\u8bcd\u65f6\uff0c\u4f7f\u7528 FEH \u6bd4\u4e0d\u4f7f\u7528 FEH \u6162\u7ea6 10%\u3002\u6700\u4f73\u5b9e\u8df5\u5305\u62ec\uff1a\u4ec5\u5728\u9700\u8981\u65f6\u4f7f\u7528 FEH\u3002\u9650\u5236\u8c03\u7528\u9891\u7387\u3002\u4f7f\u7528\u7b80\u5355\u7684\u51fd\u6570\u3002\u907f\u514d\u5904\u7406\u5927\u91cf\u6570\u636e\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241025\/1729857638671b8866a4387.jpg\" class=\"aligncenter\" title=\"PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f\u63d2\u56fe\" alt=\"PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u53ca\u5176\u5bf9\u5e94\u7528\u7a0b\u5e8f\u6027\u80fd\u7684\u5f71\u54cd<\/strong><\/p>\n<p><strong>\u7b80\u4ecb<\/strong><\/p>\n<p>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406 (FEH) \u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6280\u672f\uff0c\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u5404\u79cd\u4e8b\u4ef6\u3002\u867d\u7136 FEH \u63d0\u4f9b\u4e86\u6781\u5927\u7684\u7075\u6d3b\u6027\uff0c\u4f46\u5b83\u4e5f\u53ef\u80fd\u5bf9\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u4ea7\u751f\u5f71\u54cd\u3002<\/p>\n<p><strong>FEH \u5de5\u4f5c\u539f\u7406<\/strong><\/p>\n<p>\u5f53\u8c03\u7528 FEH \u65f6\uff0cPHP \u4f1a\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u4ee3\u7406\uff0c\u8be5\u4ee3\u7406\u4f1a\u8c03\u7528\u539f\u59cb\u51fd\u6570\u5e76\u5904\u7406\u4efb\u4f55\u9519\u8bef\u6216\u5f02\u5e38\u3002\u8fd9\u79cd\u989d\u5916\u7684\u6b65\u9aa4\u4f1a\u5f15\u8d77\u8f7b\u5fae\u7684\u5f00\u9500\uff0c\u5c24\u5176\u662f\u5728\u51fd\u6570\u9891\u7e41\u8c03\u7528\u6216\u5904\u7406\u5927\u91cf\u6570\u636e\u7684\u60c5\u51b5\u4e0b\u3002<\/p>\n<p><strong>\u6027\u80fd\u5f71\u54cd<\/strong><\/p>\n<p>FEH \u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u53d6\u51b3\u4e8e\u4ee5\u4e0b\u56e0\u7d20\uff1a<\/p>\n<ul>\n<li><strong>\u8c03\u7528\u9891\u7387\uff1a<\/strong> \u51fd\u6570\u8c03\u7528\u7684\u9891\u7387\u8d8a\u9ad8\uff0c\u5f00\u9500\u5c31\u8d8a\u5927\u3002<\/li>\n<li><strong>\u51fd\u6570\u590d\u6742\u6027\uff1a<\/strong> \u66f4\u590d\u6742\u7684\u51fd\u6570\u4f1a\u5728 FEH \u4ee3\u7406\u4e2d\u4ea7\u751f\u66f4\u9ad8\u7684\u5f00\u9500\u3002<\/li>\n<li><strong>\u6570\u636e\u5927\u5c0f\uff1a<\/strong> \u5904\u7406\u5927\u91cf\u6570\u636e\u4f1a\u52a0\u5267 FEH \u7684\u6027\u80fd\u5f71\u54cd\u3002<\/li>\n<\/ul>\n<p><strong>\u5b9e\u6218\u6848\u4f8b<\/strong><\/p>\n<p>\u4e3a\u4e86\u6f14\u793a FEH \u5bf9\u6027\u80fd\u7684\u5f71\u54cd\uff0c\u8ba9\u6211\u4eec\u6bd4\u8f83\u4e24\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528\u548c\u4e0d\u4f7f\u7528 FEH \u68c0\u6d4b\u5b57\u7b26\u4e32\u4e2d\u7684\u7279\u5b9a\u5355\u8bcd\u3002<\/p>\n<p><strong>\u4f7f\u7528 FEH\uff1a<\/strong><\/p>\n<pre>\/\/ \u4f7f\u7528 FEH \u68c0\u6d4b\u5355\u8bcd\u662f\u5426\u5b58\u5728\n$has_word = feh(function ($str) {\n    return strpos($str, 'foobar') !== false;\n});<\/pre>\n<p><strong>\u4e0d\u4f7f\u7528 FEH\uff1a<\/strong><\/p>\n<pre>\/\/ \u4e0d\u4f7f\u7528 FEH \u68c0\u6d4b\u5355\u8bcd\u662f\u5426\u5b58\u5728\n$has_word = strpos($str, 'foobar') !== false;<\/pre>\n<p><strong>\u57fa\u51c6\u6d4b\u8bd5\u7ed3\u679c<\/strong><\/p>\n<p>\u5728\u5904\u7406 100 \u4e07\u4e2a\u5b57\u7b26\u4e32\u7684\u6570\u636e\u96c6\u65f6\uff0c\u4f7f\u7528 FEH \u7684\u65b9\u6cd5\u6bd4\u4e0d\u4f7f\u7528 FEH \u7684\u65b9\u6cd5\u6162\u7ea6 10%\u3002<\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<p>\u4e3a\u4e86\u6700\u5c0f\u5316 FEH \u7684\u6027\u80fd\u5f71\u54cd\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<ul>\n<li>\u53ea\u5728\u9700\u8981\u65f6\u4f7f\u7528 FEH\u3002<\/li>\n<li>\u9650\u5236\u51fd\u6570\u8c03\u7528\u7684\u9891\u7387\u3002<\/li>\n<li>\u4f7f\u7528\u7b80\u5355\u7684\u51fd\u6570\uff0c\u4ee5\u51cf\u5c11\u4ee3\u7406\u5f00\u9500\u3002<\/li>\n<li>\u907f\u514d\u5904\u7406\u5927\u91cf\u6570\u636e\u3002<\/li>\n<\/ul>\n<p><strong>\u7ed3\u8bba<\/strong><\/p>\n<p>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406 (FEH) \u662f\u4e00\u79cd\u6709\u7528\u7684\u6280\u672f\uff0c\u4f46\u9700\u8981\u6ce8\u610f\u5176\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u3002\u5408\u7406\u7684\u5e95\u5c42\u5b9e\u73b0\u5bf9\u4e8e\u4e3a\u9700\u8981 FEH \u7684\u5e94\u7528\u7a0b\u5e8f\u5b9e\u73b0\u6700\u4f73\u6027\u80fd\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300aPHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f \u6b22\u8fce\u5404\u4f4d\u5c0f\u4f19\u4f34\u6765\u5230\u7c73\u4e91\uff0c\u76f8\u805a\u4e8e\u6b64\u90fd\u662f\u7f18\u54c8\u54c8\u54c8\uff01\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u300aPHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u662f\u5426\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\uff1f\u300b\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\uff0c\u5982\u679c\u4f60\u5bf9\u6587\u7ae0\u76f8\u5173\u7684\u77e5\u8bc6\u975e\u5e38\u611f\u5174\u8da3\u6216\u8005\u6b63\u5728\u81ea\u5b66\uff0c\u90fd\u53ef\u4ee5\u5173\u6ce8\u6211\uff0c\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u6587\u7ae0\uff01\u5f53\u7136\uff0c\u6709\u4ec0\u4e48\u5efa\u8bae\u4e5f\u6b22\u8fce\u5728\u8bc4\u8bba\u7559\u8a00\u63d0\u51fa\uff01\u4e00\u8d77\u5b66\u4e60\uff01 PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406 (FEH) \u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6280\u672f\uff0c\u5141\u8bb8\u5904\u7406\u5404\u79cd\u4e8b\u4ef6\uff0c\u4f46\u5b83\u53ef\u80fd\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u6027\u80fd\uff1aFEH \u521b\u5efa\u4e00\u4e2a\u4ee3\u7406\u51fd\u6570\uff0c\u5bfc\u81f4\u5f00\u9500\uff0c\u5c24\u5176\u662f\u5728\u9891\u7e41\u8c03\u7528\u6216\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u3002\u5f71\u54cd\u56e0\u7d20\u5305\u62ec\u8c03\u7528\u9891\u7387\u3001\u51fd\u6570\u590d\u6742\u6027\u548c\u6570\u636e\u5927\u5c0f\uff0c\u4f8b\u5982\uff1a\u68c0\u6d4b\u5b57\u7b26\u4e32\u4e2d\u5355\u8bcd\u65f6\uff0c\u4f7f\u7528 FEH \u6bd4\u4e0d\u4f7f\u7528 FEH \u6162\u7ea6 10%\u3002\u6700\u4f73\u5b9e\u8df5\u5305\u62ec\uff1a\u4ec5\u5728\u9700\u8981\u65f6\u4f7f\u7528 FEH\u3002\u9650\u5236\u8c03\u7528\u9891\u7387\u3002\u4f7f\u7528\u7b80\u5355\u7684\u51fd\u6570\u3002\u907f\u514d\u5904\u7406\u5927\u91cf\u6570\u636e\u3002 PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406\u6280\u672f\u53ca\u5176\u5bf9\u5e94\u7528\u7a0b\u5e8f\u6027\u80fd\u7684\u5f71\u54cd \u7b80\u4ecb PHP \u51fd\u6570\u4e8b\u4ef6\u5904\u7406 (FEH) \u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6280\u672f\uff0c\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u56de\u8c03\u51fd\u6570\u6765\u5904\u7406\u5404\u79cd\u4e8b\u4ef6\u3002\u867d\u7136 FEH \u63d0\u4f9b\u4e86\u6781\u5927\u7684\u7075\u6d3b\u6027\uff0c\u4f46\u5b83\u4e5f\u53ef\u80fd\u5bf9\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u4ea7\u751f\u5f71\u54cd\u3002 FEH \u5de5\u4f5c\u539f\u7406 \u5f53\u8c03\u7528 FEH \u65f6\uff0cPHP \u4f1a\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\u4ee3\u7406\uff0c\u8be5\u4ee3\u7406\u4f1a\u8c03\u7528\u539f\u59cb\u51fd\u6570\u5e76\u5904\u7406\u4efb\u4f55\u9519\u8bef\u6216\u5f02\u5e38\u3002\u8fd9\u79cd\u989d\u5916\u7684\u6b65\u9aa4\u4f1a\u5f15\u8d77\u8f7b\u5fae\u7684\u5f00\u9500\uff0c\u5c24\u5176\u662f\u5728\u51fd\u6570\u9891\u7e41\u8c03\u7528\u6216\u5904\u7406\u5927\u91cf\u6570\u636e\u7684\u60c5\u51b5\u4e0b\u3002 \u6027\u80fd\u5f71\u54cd FEH \u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u53d6\u51b3\u4e8e\u4ee5\u4e0b\u56e0\u7d20\uff1a \u8c03\u7528\u9891\u7387\uff1a \u51fd\u6570\u8c03\u7528\u7684\u9891\u7387\u8d8a\u9ad8\uff0c\u5f00\u9500\u5c31\u8d8a\u5927\u3002 \u51fd\u6570\u590d\u6742\u6027\uff1a \u66f4\u590d\u6742\u7684\u51fd\u6570\u4f1a\u5728 FEH \u4ee3\u7406\u4e2d\u4ea7\u751f\u66f4\u9ad8\u7684\u5f00\u9500\u3002 \u6570\u636e\u5927\u5c0f\uff1a \u5904\u7406\u5927\u91cf\u6570\u636e\u4f1a\u52a0\u5267 FEH \u7684\u6027\u80fd\u5f71\u54cd\u3002 \u5b9e\u6218\u6848\u4f8b \u4e3a\u4e86\u6f14\u793a FEH \u5bf9\u6027\u80fd\u7684\u5f71\u54cd\uff0c\u8ba9\u6211\u4eec\u6bd4\u8f83\u4e24\u79cd\u65b9\u6cd5\uff1a\u4f7f\u7528\u548c\u4e0d\u4f7f\u7528 FEH \u68c0\u6d4b\u5b57\u7b26\u4e32\u4e2d\u7684\u7279\u5b9a\u5355\u8bcd\u3002 \u4f7f\u7528 FEH\uff1a \/\/ \u4f7f\u7528 FEH \u68c0\u6d4b\u5355\u8bcd\u662f\u5426\u5b58\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-46969","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/46969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=46969"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/46969\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=46969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=46969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=46969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}