{"id":389,"date":"2022-10-27T08:53:51","date_gmt":"2022-10-27T08:53:51","guid":{"rendered":"https:\/\/www.devopstrainer.in\/blog\/?p=389"},"modified":"2022-10-27T08:53:51","modified_gmt":"2022-10-27T08:53:51","slug":"what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example","status":"publish","type":"post","link":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/","title":{"rendered":"What are the types of Array in PHP? Plz provide an explanation with an example."},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png\" alt=\"\" class=\"wp-image-397\" width=\"700\" height=\"264\" srcset=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png 902w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1-300x113.png 300w, https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1-768x290.png 768w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption><strong>Types of an array in PHP<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p>There are three types of Array in PHP with examples.<\/p>\n\n\n\n<p><strong>Numeric\/Indexed Array <\/strong>\u2013 In this array index will be represented by a number. By default numeric array index start from 0.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ex: - $num &#91;0] = \u201cRahul\u201d;<\/code><\/pre>\n\n\n\n<p><strong>Associative Array<\/strong> \u2013 In this Array index\/key will be represented by a string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ex: - $fees &#91;\u201cRahul\u201d] = 500;<\/code><\/pre>\n\n\n\n<p><strong>Multidimensional Array<\/strong> \u2013 Arrays of Arrays is known as multidimensional arrays.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Ex: - $num &#91;0] &#91;0] = 25;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are three types of Array in PHP with examples. Numeric\/Indexed Array \u2013 In this array index will be represented by a number. By default numeric array&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[145,113],"tags":[157,154,156,155],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-array","category-php","tag-associative-array","tag-multidimensional-array","tag-numeric-indexed-array","tag-types-of-array-in-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps<\/title>\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.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps\" \/>\n<meta property=\"og:description\" content=\"There are three types of Array in PHP with examples. Numeric\/Indexed Array \u2013 In this array index will be represented by a number. By default numeric array...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps | SRE | DevSecOps\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-27T08:53:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png\" \/>\n<meta name=\"author\" content=\"rahulkr kr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rahulkr kr\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/\"},\"author\":{\"name\":\"rahulkr kr\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/#\\\/schema\\\/person\\\/e9fd1d88de76754aa189257cd197394d\"},\"headline\":\"What are the types of Array in PHP? Plz provide an explanation with an example.\",\"datePublished\":\"2022-10-27T08:53:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/\"},\"wordCount\":74,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/array-types-php-1.png\",\"keywords\":[\"Associative Array\",\"multidimensional array\",\"Numeric\\\/Indexed Array\",\"types of Array in PHP\"],\"articleSection\":[\"Array\",\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/\",\"url\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/\",\"name\":\"What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/array-types-php-1.png\",\"datePublished\":\"2022-10-27T08:53:51+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/#\\\/schema\\\/person\\\/e9fd1d88de76754aa189257cd197394d\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/array-types-php-1.png\",\"contentUrl\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/array-types-php-1.png\",\"width\":902,\"height\":341},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What are the types of Array in PHP? Plz provide an explanation with an example.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/\",\"name\":\"DevOps | SRE | DevSecOps\",\"description\":\"Automation means Cost, Quality, Time\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/#\\\/schema\\\/person\\\/e9fd1d88de76754aa189257cd197394d\",\"name\":\"rahulkr kr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g\",\"caption\":\"rahulkr kr\"},\"url\":\"https:\\\/\\\/www.devopstrainer.in\\\/blog\\\/author\\\/rahulkr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps","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.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/","og_locale":"en_US","og_type":"article","og_title":"What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps","og_description":"There are three types of Array in PHP with examples. Numeric\/Indexed Array \u2013 In this array index will be represented by a number. By default numeric array...","og_url":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/","og_site_name":"DevOps | SRE | DevSecOps","article_published_time":"2022-10-27T08:53:51+00:00","og_image":[{"url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png","type":"","width":"","height":""}],"author":"rahulkr kr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rahulkr kr"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#article","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/"},"author":{"name":"rahulkr kr","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/e9fd1d88de76754aa189257cd197394d"},"headline":"What are the types of Array in PHP? Plz provide an explanation with an example.","datePublished":"2022-10-27T08:53:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/"},"wordCount":74,"commentCount":0,"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png","keywords":["Associative Array","multidimensional array","Numeric\/Indexed Array","types of Array in PHP"],"articleSection":["Array","PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/","url":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/","name":"What are the types of Array in PHP? Plz provide an explanation with an example. - DevOps | SRE | DevSecOps","isPartOf":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#primaryimage"},"image":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png","datePublished":"2022-10-27T08:53:51+00:00","author":{"@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/e9fd1d88de76754aa189257cd197394d"},"breadcrumb":{"@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#primaryimage","url":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png","contentUrl":"https:\/\/www.devopstrainer.in\/blog\/wp-content\/uploads\/2022\/10\/array-types-php-1.png","width":902,"height":341},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopstrainer.in\/blog\/what-are-the-types-of-array-in-php-plz-provide-an-explanation-with-an-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopstrainer.in\/blog\/"},{"@type":"ListItem","position":2,"name":"What are the types of Array in PHP? Plz provide an explanation with an example."}]},{"@type":"WebSite","@id":"https:\/\/www.devopstrainer.in\/blog\/#website","url":"https:\/\/www.devopstrainer.in\/blog\/","name":"DevOps | SRE | DevSecOps","description":"Automation means Cost, Quality, Time","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopstrainer.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopstrainer.in\/blog\/#\/schema\/person\/e9fd1d88de76754aa189257cd197394d","name":"rahulkr kr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/79531cbaf0b831cebc9631f6ac28f21fb3fb0dc2615eeecdeeec43038b513473?s=96&d=mm&r=g","caption":"rahulkr kr"},"url":"https:\/\/www.devopstrainer.in\/blog\/author\/rahulkr\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":5,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":398,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/posts\/389\/revisions\/398"}],"wp:attachment":[{"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopstrainer.in\/blog\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}