{"id":670,"date":"2014-07-21T06:16:16","date_gmt":"2014-07-21T06:16:16","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=670"},"modified":"2014-07-21T06:16:16","modified_gmt":"2014-07-21T06:16:16","slug":"php%e6%ad%a3%e5%88%99%e5%8c%b9%e9%85%8d%e5%ad%97%e7%ac%a6%e4%b8%b2%e4%b8%ad%e7%9a%84%e4%b8%ad%e6%96%87%e5%86%85%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/670.html","title":{"rendered":"PHP\u6b63\u5219\u5339\u914d\u5b57\u7b26\u4e32\u4e2d\u7684\u4e2d\u6587\u5185\u5bb9"},"content":{"rendered":"<p style=\"color: #000000;\">\u5982\u679c\u6807\u7b7e\u91cc\u9762\u6709\u4e2d\u6587\u3001\u82f1\u6587\u3001\u6570\u5b57\u7b49\u6df7\u6392\uff0c\u5219\u9700\u8981\u5bf9\u6c49\u5b57\u8fdb\u884c\u7279\u6b8a\u5904\u7406\uff0c\u7531\u4e8ePCRE\u4e0d\u652f\u6301U P L\u4e4b\u7c7b\u7684perl\u5b57\u7b26\u4e32\u5904\u7406\u8f6c\u4e49\uff0c\u6240\u4ee5<strong><span style=\"color: #ff0000;\">\u9700\u8981\u4f7f\u752816\u8fdb\u5236\u6216\u8005Unicode\u8fdb\u884c\u5904\u7406<\/span><\/strong><\/p>\n<h6 style=\"color: #000000;\">\u8303\u4f8b\u5982\u4e0b\uff1a<\/h6>\n<pre class=\"lang:default decode:true\">&lt;?php\n$str = \"\u4e4b\u4e8c\u5bbd\u9614\u7684\u7518\u5bb6\u53e3\u4e1c#\u6807\u7b7e1#\u6807\u7b7e2 #\u6807\u7b7e3\u3002#\u6807\u7b7e4,\u90fd\u53d1$1234 \uffe5xc,cvm , \uffe512,dflksjf\u5982\u4f55#\u6807\u7b7e5.x #tag6.cvxcv\u201c\";\npreg_match_all('\/#([a-zA-Z0-9x7f-xff]+)\/', $str, $mat);\nprint_r($mat);\n\npreg_match(\"\/[x{00a5}x{ffe5}](d+)\/u\", $str, $mat);\nprint_r($mat);<\/pre>\n<h6 style=\"color: #000000;\">\u5f97\u5230\u7684\u7ed3\u679c\u5982\u4e0b\uff1a<\/h6>\n<p style=\"color: #000000;\"><code>Array<br \/>\n(<br \/>\n[0] =&gt; Array<br \/>\n(<br \/>\n[0] =&gt; #\u6807\u7b7e1<br \/>\n[1] =&gt; #\u6807\u7b7e2<br \/>\n[2] =&gt; #\u6807\u7b7e3\u3002<br \/>\n[3] =&gt; #\u6807\u7b7e4<br \/>\n[4] =&gt; #\u6807\u7b7e5<br \/>\n[5] =&gt; #tag6<br \/>\n)<\/code><\/p>\n<p>[1] =&gt; Array<br \/>\n(<br \/>\n[0] =&gt; \u6807\u7b7e1<br \/>\n[1] =&gt; \u6807\u7b7e2<br \/>\n[2] =&gt; \u6807\u7b7e3\u3002<br \/>\n[3] =&gt; \u6807\u7b7e4<br \/>\n[4] =&gt; \u6807\u7b7e5<br \/>\n[5] =&gt; tag6<br \/>\n)<\/p>\n<p style=\"color: #000000;\"><code>)<br \/>\nArray<br \/>\n(<br \/>\n[0] =&gt; \uffe512<br \/>\n[1] =&gt; 12<br \/>\n)<br \/>\n<\/code><\/p>\n<h5 style=\"color: #000000;\">\u8865\u5145\u8bf4\u660e\uff1a<\/h5>\n<h6 style=\"color: #000000;\">\u53cc\u5b57\u8282\u5b57\u7b26\u7f16\u7801\u8303\u56f4<\/h6>\n<p style=\"color: #000000;\">1. GBK (GB2312\/GB18030)<br \/>\nx00-xff GBK\u53cc\u5b57\u8282\u7f16\u7801\u8303\u56f4<br \/>\nx20-x7f ASCII<br \/>\nxa1-xff \u4e2d\u6587 gb2312<br \/>\nx80-xff \u4e2d\u6587 gbk<\/p>\n<p style=\"color: #000000;\">2. UTF-8 (Unicode)<\/p>\n<p style=\"color: #000000;\">u4e00-u9fa5 (\u4e2d\u6587)<br \/>\nx3130-x318F (\u97e9\u6587<br \/>\nxAC00-xD7A3 (\u97e9\u6587)<br \/>\nu0800-u4e00 (\u65e5\u6587)<\/p>\n<div style=\"color: #000000;\">\n<hr \/>\n<p><span style=\"color: #000000; font-size: medium;\">\u5728\u6d4b\u8bd5\u8fd9\u4e2a\u811a\u672c\u65f6\u5019\u53d1\u73b0\u7684\u4e00\u4e2a\u5c0f\u6280\u5de7\uff1a<\/span><\/p>\n<\/div>\n<div style=\"color: #000000;\"><span style=\"color: #000000; font-size: medium;\">\u4f30\u8ba1\u5e94\u8be5\u662fWindows7\u4e2d\u6587\u7248\u672c\u8eab\u7684\u7cfb\u7edf\u7f16\u7801\u539f\u56e0\uff0c\u6240\u4ee5\uff0c\u5728\u6d4b\u8bd5\u4e0a\u9762\u8fd9\u4e2a\u811a\u672c\u65f6\uff0c\u4f7f\u7528CMD\u63a7\u5236\u53f0\u8f93\u51fa\u65f6\uff0c\u4f1a\u51fa\u73b0\u4e71\u7801\uff1b<\/span><\/div>\n<div style=\"color: #000000;\"><span style=\"color: #000000; font-size: medium;\">\u4f46\u662f\uff0c\u5f53\u4f7f\u7528EditPlus\u6267\u884c\u8f93\u51fa\u65f6\u5c31\u6ca1\u6709\u4e71\u7801\u7684\u95ee\u9898\u3002<\/span><\/div>\n<div style=\"color: #000000;\"><span style=\"color: #000000; font-size: medium;\">\uff08\u4ee5\u540e\u4e0d\u8bba\u662f\u6d4b\u8bd5PHP\u8fd8\u662fPython\u4ea6\u6216\u662f\u5176\u4ed6\u7684\u811a\u672c\uff0c\u90fd\u53ef\u4ee5\u8003\u8651\u7528\u8fd9\u79cd\u65b9\u6cd5\u907f\u514d\u4e71\u7801\u5e26\u6765\u7684\u5e72\u6270\u3002\uff09<\/span><\/div>\n<h6>\u53c2\u8003\u5730\u5740\uff1a<\/h6>\n<p><a href=\"http:\/\/www.toplee.com\/blog\/1319.html\" target=\"_blank\">PHP\u6b63\u5219\u5339\u914d\u5b57\u7b26\u4e32\u4e2d\u7684\u6807\u7b7e | Michael`s blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u6807\u7b7e\u91cc\u9762\u6709\u4e2d\u6587\u3001\u82f1\u6587\u3001\u6570\u5b57\u7b49\u6df7\u6392\uff0c\u5219\u9700\u8981\u5bf9\u6c49\u5b57\u8fdb\u884c\u7279\u6b8a\u5904\u7406\uff0c\u7531\u4e8ePCRE\u4e0d\u652f\u6301U P L\u4e4b\u7c7b\u7684perl\u5b57\u7b26 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,7],"tags":[48,105],"class_list":["post-670","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-programing","tag-php","tag-preg_match_all"],"views":2496,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=670"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/670\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}