{"id":30258,"date":"2023-09-30T23:06:20","date_gmt":"2022-12-15T06:48:55","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/"},"modified":"2025-08-12T18:20:13","modified_gmt":"2025-08-12T10:20:13","slug":"php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/","title":{"rendered":"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u5173\u4e8ePHP\u7684\u6570\u7ec4<\/h2>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528array()\u51fd\u6570\u6765\u521b\u5efa\u4e00\u4e2a\u7531\u7279\u5b9a\u6570\u91cf\u7684\u9017\u53f7\u5206\u9694\u7684\u952e =&gt; \u503c\u53c2\u6570\u7ec4\u6210\u7684\u6570\u7ec4\u3002<br \/>\n\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?php\r\n$array = array(\r\n    1    =&gt; \"\u6771\u4eac\u90fd\",\r\n    2    =&gt; \"\u5927\u962a\u5e9c\",\r\n    3    =&gt; \"\u4eac\u90fd\u5e9c\",\r\n    4    =&gt; \"\u5317\u6d77\u9053\",\r\n);\r\nvar_dump($array);\r\n?&gt;\r\n\r\n<\/code><\/pre>\n<p>\u5c06\u5de6\u4fa7\u76841~4\u6570\u5b57\u79f0\u4e3a\u952e\uff0c\u5c06\u53f3\u4fa7\u79f0\u4e3a\u503c\u3002\u5f53\u9700\u8981\u63d0\u53d6\u7279\u5b9a\u503c\u65f6\uff0c\u8bf7\u4f7f\u7528\u952e\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n<p>\u203bvar_dump \u53ef\u4ee5\u8be6\u7ec6\u8f93\u51fa\u53d8\u91cf\u6216\u8fd4\u56de\u503c\u7684\u51fd\u6570\u3002\u5982\u679c\u503c\u662f\u5b57\u7b26\u4e32\uff0c\u5219\u4e3a string\uff1b\u5982\u679c\u662f\u6570\u5b57\uff0c\u5219\u4e3a integer\u3002<\/p>\n<p>\u5982\u679c\u4f7f\u7528`var_dump($array[2])`\uff0c\u53ef\u4ee5\u53d6\u51fa\u952e\u4e3a2\u7684\u503c\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?php\r\n$array = array(\r\n    1    =&gt; \"\u6771\u4eac\u90fd\",\r\n    2    =&gt; \"\u5927\u962a\u5e9c\",\r\n    3    =&gt; \"\u4eac\u90fd\u5e9c\",\r\n    4    =&gt; \"\u5317\u6d77\u9053\",\r\n);\r\nvar_dump($array[2]);\r\n?&gt;\r\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c<\/p>\n<pre class=\"post-pre\"><code>string(9) \"\u5927\u962a\u5e9c\"\r\n<\/code><\/pre>\n<p>string\u662f\u4e00\u79cd\u5b57\u7b26\u6570\u636e\u7c7b\u578b<\/p>\n<p>\u5982\u679c\u5c06var_dump\u66f4\u6539\u4e3aprint\uff0c\u90a3\u53ea\u4f1a\u663e\u793a\u6570\u503c\uff08\u4e0evar_dump\u76f8\u6bd4\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?php\r\n$array = array(\r\n    1    =&gt; \"\u6771\u4eac\u90fd\",\r\n    2    =&gt; \"\u5927\u962a\u5e9c\",\r\n    3    =&gt; \"\u4eac\u90fd\u5e9c\",\r\n    4    =&gt; \"\u5317\u6d77\u9053\",\r\n);\r\nprint($array[2]);\r\n?&gt;\r\n<\/code><\/pre>\n<h3>\u5728\u4ee3\u7801\u4e2d\u7701\u7565\u952e\u5e76\u5199\u5165\u6570\u7ec4\u3002<\/h3>\n<p>\u53e6\u5916\uff0c\u7531\u4e8e\u952e\u662f\u53ef\u9009\u7684\uff0c\u56e0\u6b64\u53ef\u4ee5\u7701\u7565\u952e\uff0c\u7528\u6570\u7ec4\u8868\u793a\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?php\r\n$location = array('\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u5317\u6d77\u9053');\r\n                    [0]      [1]      [2]      [3]\r\nvar_dump($location);\r\n?&gt;\r\n<\/code><\/pre>\n<p>\u8981\u83b7\u53d6\u7279\u5b9a\u5b57\u7b26\u4e32\u65f6\uff0c\u8bf7\u6309\u4ee5\u4e0b\u65b9\u5f0f\u7f16\u5199\uff08\u6ce8\u610f\u5b57\u7b26\u4e32\u7d22\u5f15\u4ece[0]\u5f00\u59cb\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code>var_dump($location[0]);\r\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c<\/p>\n<pre class=\"post-pre\"><code>string(9) \"\u6771\u4eac\u90fd\"\r\n<\/code><\/pre>\n<p>\u8bf7\u7528\u81ea\u7136\u7684\u6c49\u8bed\u6539\u5199\u4ee5\u4e0b\u53e5\u5b50\uff0c\u53ea\u9700\u8981\u7ed9\u4e00\u4e2a\u9009\u9879\uff1a<br \/>\n1. Did you eat breakfast this morning?<br \/>\n2. I need to buy some groceries for dinner.<br \/>\n3. The movie starts at 8 pm tonight.<br \/>\n4. She speaks three languages fluently.<br \/>\n5. I am going to visit my grandparents next weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8ePHP\u7684\u6570\u7ec4 \u4f60\u53ef\u4ee5\u4f7f\u7528array()\u51fd\u6570\u6765\u521b\u5efa\u4e00\u4e2a\u7531\u7279\u5b9a\u6570\u91cf\u7684\u9017\u53f7\u5206\u9694\u7684\u952e =&gt; \u503c\u53c2\u6570\u7ec4\u6210\u7684\u6570\u7ec4 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-30258","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\u306e\u914d\u5217\u306b\u3064\u3044\u3066 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\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\u306e\u914d\u5217\u306b\u3064\u3044\u3066\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/php\u306e\u914d\u5217\u306b\u3064\u3044\u3066\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-15T06:48:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T10:20:13+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\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%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/\",\"name\":\"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-12-15T06:48:55+00:00\",\"dateModified\":\"2025-08-12T10:20:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"description\":\"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\"}]},{\"@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\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066 - Blog - Silicon Cloud","description":"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\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\u306e\u914d\u5217\u306b\u3064\u3044\u3066\/","og_locale":"zh_CN","og_type":"article","og_title":"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066","og_description":"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/php\u306e\u914d\u5217\u306b\u3064\u3044\u3066\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-12-15T06:48:55+00:00","article_modified_time":"2025-08-12T10:20:13+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/","name":"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-12-15T06:48:55+00:00","dateModified":"2025-08-12T10:20:13+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"description":"\u5173\u4e8ePHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP\u306e\u914d\u5217\u306b\u3064\u3044\u3066"}]},{"@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\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/php%e3%81%ae%e9%85%8d%e5%88%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30258","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=30258"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30258\/revisions"}],"predecessor-version":[{"id":56818,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/30258\/revisions\/56818"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=30258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=30258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=30258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}