{"id":30647,"date":"2022-12-31T21:38:38","date_gmt":"2023-08-30T10:22:37","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/"},"modified":"2025-08-12T20:10:25","modified_gmt":"2025-08-12T12:10:25","slug":"php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/","title":{"rendered":"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7"},"content":{"rendered":"<h2>\u7528\u6cd5<\/h2>\n<p>\u5728\u9700\u8981\u5220\u9664\u8868\u60c5\u7b26\u53f7\u65f6\u4f7f\u7528PHP\u3002<br \/>\n\u5728\u4e0d\u60f3\u5728\u6570\u636e\u5e93\u4e2d\u4fdd\u5b58\u8868\u60c5\u7b26\u53f7\u65f6\uff0c\u6216\u8005\u9700\u8981\u63d0\u524d\u4ece\u503c\u4e2d\u5220\u9664\u8868\u60c5\u7b26\u53f7\u65f6\u4f7f\u7528\u3002<\/p>\n<div>\u8fd9\u4e2a\u4ee3\u7801\u662f\u7528\u6765\u5220\u96644\u5b57\u8282\u7684\u8868\u60c5\u7b26\u53f7\u3002\uff083\u5b57\u8282\u7684\u8868\u60c5\u7b26\u53f7\u5728\u672c\u6b21\u4ee3\u7801\u4e2d\u65e0\u6cd5\u5220\u9664\uff09<\/div>\n<h2>\u7528\u6cd5<\/h2>\n<pre class=\"post-pre\"><code><span class=\"nb\">preg_replace<\/span><span class=\"p\">(<\/span><span class=\"s1\">'\/[\\xF0-\\xF7][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]\/'<\/span><span class=\"p\">,<\/span> <span class=\"s1\">''<\/span><span class=\"p\">,<\/span> <span class=\"nv\">$hoge<\/span><span class=\"p\">);<\/span>\r\n<\/code><\/pre>\n<p>\u7b2c\u4e00\u4e2a\u53c2\u6570 \u2192 \u5339\u914d4\u5b57\u8282\u8868\u60c5\u7b26\u53f7\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<br \/>\n\u7b2c\u4e8c\u4e2a\u53c2\u6570 \u2192 \u4e3a\u4e86\u7f6e\u7a7a\u800c\u53ea\u6709\u5f15\u53f7<br \/>\n\u7b2c\u4e09\u4e2a\u53c2\u6570 \u2192 \u76ee\u6807\u503c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u6cd5 \u5728\u9700\u8981\u5220\u9664\u8868\u60c5\u7b26\u53f7\u65f6\u4f7f\u7528PHP\u3002 \u5728\u4e0d\u60f3\u5728\u6570\u636e\u5e93\u4e2d\u4fdd\u5b58\u8868\u60c5\u7b26\u53f7\u65f6\uff0c\u6216\u8005\u9700\u8981\u63d0\u524d\u4ece\u503c\u4e2d\u5220\u9664\u8868\u60c5\u7b26\u53f7\u65f6\u4f7f\u7528\u3002 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-30647","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/php-\u5220\u9664\u8868\u60c5\u7b26\u53f7\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/php-\u5220\u9664\u8868\u60c5\u7b26\u53f7\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-30T10:22:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T12:10:25+00:00\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/\",\"name\":\"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-08-30T10:22:37+00:00\",\"dateModified\":\"2025-08-12T12:10:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"description\":\"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7 - Blog - Silicon Cloud","description":"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/php-\u5220\u9664\u8868\u60c5\u7b26\u53f7\/","og_locale":"zh_CN","og_type":"article","og_title":"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7","og_description":"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/php-\u5220\u9664\u8868\u60c5\u7b26\u53f7\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-30T10:22:37+00:00","article_modified_time":"2025-08-12T12:10:25+00:00","author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/","name":"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-08-30T10:22:37+00:00","dateModified":"2025-08-12T12:10:25+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"description":"\u5173\u4e8ePHP \u5220\u9664\u8868\u60c5\u7b26\u53f7\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP \u5220\u9664\u8868\u60c5\u7b26\u53f7"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php-%e5%88%a0%e9%99%a4%e8%a1%a8%e6%83%85%e7%ac%a6%e5%8f%b7\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=30647"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30647\/revisions"}],"predecessor-version":[{"id":56918,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30647\/revisions\/56918"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=30647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=30647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=30647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}