{"id":49408,"date":"2024-12-02T10:24:26","date_gmt":"2024-12-02T02:24:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/49408\/"},"modified":"2024-12-02T10:24:26","modified_gmt":"2024-12-02T02:24:26","slug":"php%e4%b8%ad%e6%96%87%e6%95%b0%e7%bb%84%e6%8e%92%e5%ba%8f%e7%bb%93%e6%9e%9c%e4%b8%ba%e4%bd%95%e5%9c%a8%e4%b8%8d%e5%90%8cide%e4%b8%ad%e5%b7%ae%e5%bc%82%e5%b7%a8%e5%a4%a7%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/49408\/","title":{"rendered":"PHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>PHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f<\/h1>\n<p>\u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300aPHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241201\/1733031392674bf5e0ae448.jpg\" class=\"aligncenter\" title=\"PHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f\u63d2\u56fe\" alt=\"PHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>php\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u4e2d\u7684\u5dee\u5f02<\/strong><\/p>\n<p>\u5bf9\u4e8e\u4e2d\u6587\u6570\u7ec4\u7684\u6392\u5e8f\uff0c\u5728\u4e0d\u540c\u7684ide\u73af\u5883\u4e2d\u53ef\u80fd\u4ea7\u751f\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u539f\u56e0\u662fide\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u540c\u3002<\/p>\n<p>\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre>$array = array(\n    '\u9999\u8549',\n    '\u82f9\u679c',\n    '\u6a58\u5b50',\n    '\u897f\u74dc'\n);\n\nforeach ($array as $value) {\n    $value = mb_convert_encoding($value, 'gb18030');\n}\nasort($array);<\/pre>\n<p><strong>phpstorm\u4e2d\u7684\u7ed3\u679c\uff1a<\/strong><\/p>\n<pre>iso-8859-1array ( [1] =&gt; \u82f9\u679c [3] =&gt; \u897f\u74dc [0] =&gt; \u9999\u8549 [2] =&gt; \u6a58\u5b50 )<\/pre>\n<p><strong>zend studio\u4e2d\u7684\u7ed3\u679c\uff1a<\/strong><\/p>\n<pre>iso-8859-1array ( [2] =&gt; \u6a58\u5b50 [1] =&gt; \u82f9\u679c [3] =&gt; \u897f\u74dc [0] =&gt; \u9999\u8549 )<\/pre>\n<p>\u5dee\u5f02\u7684\u539f\u56e0\u5728\u4e8e$array\u4e2d\u5143\u7d20\u7684utf-8\u7f16\u7801\u548ciso-8859-1\u7f16\u7801\u4e4b\u95f4\u7684\u533a\u522b\u3002\u5728zend studio\u4e2d\uff0c\u9ed8\u8ba4\u4f7f\u7528iso-8859-1\u7f16\u7801\uff0c\u56e0\u6b64\u5143\u7d20\u6392\u5e8f\u57fa\u4e8e\u6b64\u7f16\u7801\u3002\u800c\u5728phpstorm\u4e2d\uff0c\u9ed8\u8ba4\u4f7f\u7528utf-8\u7f16\u7801\uff0c\u56e0\u6b64\u5143\u7d20\u6392\u5e8f\u57fa\u4e8eutf-8\u7f16\u7801\u3002<\/p>\n<p>\u4e3a\u4e86\u786e\u4fdd\u5728\u4e0d\u540cide\u73af\u5883\u4e2d\u83b7\u5f97\u4e00\u81f4\u7684\u6392\u5e8f\u7ed3\u679c\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u663e\u5f0f\u6307\u5b9a\u5b57\u7b26\u7f16\u7801\uff0c\u4f7f\u7528\u4ee5\u4e0b\u51fd\u6570\uff1a<\/p>\n<pre>mb_convert_encoding( $str, $encoding1,$encoding2 )<\/pre>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f \u6765\u5230\u7c73\u4e91\u7684\u5927\u5bb6\uff0c\u76f8\u4fe1\u90fd\u662f\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5e0c\u671b\u5728\u8fd9\u91cc\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7f16\u7a0b\u77e5\u8bc6\u3002\u4e0b\u9762\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u5e26\u5927\u5bb6\u804a\u804a\u300aPHP\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u7ed3\u679c\u4e3a\u4f55\u5728\u4e0d\u540cIDE\u4e2d\u5dee\u5f02\u5de8\u5927\uff1f\u300b\uff0c\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01 php\u4e2d\u6587\u6570\u7ec4\u6392\u5e8f\u4e2d\u7684\u5dee\u5f02 \u5bf9\u4e8e\u4e2d\u6587\u6570\u7ec4\u7684\u6392\u5e8f\uff0c\u5728\u4e0d\u540c\u7684ide\u73af\u5883\u4e2d\u53ef\u80fd\u4ea7\u751f\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u539f\u56e0\u662fide\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u540c\u3002 \u793a\u4f8b\u4ee3\u7801\uff1a $array = array( &#8216;\u9999\u8549&#8217;, &#8216;\u82f9\u679c&#8217;, &#8216;\u6a58\u5b50&#8217;, &#8216;\u897f\u74dc&#8217; ); foreach ($array as $value) { $value = mb_convert_encoding($value, &#8216;gb18030&#8217;); } asort($array); phpstorm\u4e2d\u7684\u7ed3\u679c\uff1a iso-8859-1array ( [1] =&gt; \u82f9\u679c [3] =&gt; \u897f\u74dc [0] =&gt; \u9999\u8549 [2] =&gt; \u6a58\u5b50 ) zend studio\u4e2d\u7684\u7ed3\u679c\uff1a iso-8859-1array ( [2] =&gt; \u6a58\u5b50 [1] =&gt; \u82f9\u679c [3] =&gt; \u897f\u74dc [0] =&gt; [&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-49408","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49408","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=49408"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49408\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=49408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=49408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=49408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}