<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Two dimensional array Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/two-dimensional-array/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/two-dimensional-array/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Thu, 05 Aug 2021 13:24:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Complete Tutorial of Multidimensional Array</title>
		<link>https://www.scmgalaxy.com/tutorials/complete-tutorial-of-multidimensional-array/</link>
					<comments>https://www.scmgalaxy.com/tutorials/complete-tutorial-of-multidimensional-array/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 13:24:54 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Complete Tutorial of Multidimensional Array]]></category>
		<category><![CDATA[Dimensions]]></category>
		<category><![CDATA[Multidimensional Array]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Tutorial of Multidimensional Array]]></category>
		<category><![CDATA[Two dimensional array]]></category>
		<category><![CDATA[Two dimensional associative array]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7463</guid>

					<description><![CDATA[<p>Multi-dimensional arrays are arrays that instead of storing a single element, store another array at each index. To put it [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/complete-tutorial-of-multidimensional-array/">Complete Tutorial of Multidimensional Array</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Multi-dimensional arrays are arrays that instead of storing a single element, store another array at each index. To put it another way, multi-dimensional arrays should be defined as an array of arrays. Every element in this array can be an array, and they can also have additional sub-arrays within them, as the name implies. Multiple dimensions can be used to access arrays or sub-arrays in multidimensional arrays.</p>



<p class="wp-block-paragraph"><strong>Dimensions:</strong>&#8211; The number of indices required to pick an element is indicated by the dimensions of a multidimensional array. To pick an element from a two-dimensional array, use two indices.</p>



<p class="wp-block-paragraph"><strong>Two dimensional array:</strong>&#8211; It&#8217;s the most basic type of multidimensional array. It may be made with the help of a nested array. The index of these arrays is always a number, and they can store any sort of element. The index starts at zero by default.</p>



<p class="wp-block-paragraph"><strong>Syntax:-</strong> </p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">array (
    array (elements...),
<code>    array (elements...),
    ...
)</code></span></code></pre>



<p class="wp-block-paragraph"><strong>Example:</strong>&#8211; </p>



<script src="https://gist.github.com/AdarshAshwani/ed7979d782c102d06ce8a0f740a308e0.js"></script>



<p class="wp-block-paragraph"><strong>Output:-</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="489" height="466" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-42.png" alt="" class="wp-image-7465" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-42.png 489w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-42-300x286.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></figure></div>



<p class="wp-block-paragraph"><strong>Two dimensional associative array:</strong>&#8211; Al associative arrays are similar to indexed arrays, except that instead of linear storage (indexed storage), each value can be associated with a user-defined string key.</p>



<div class="wp-block-image"><figure class="aligncenter"><img decoding="async" src="https://media.geeksforgeeks.org/wp-content/uploads/3D-array.jpg" alt="Multidimensional arrays in PHP - GeeksforGeeks"/></figure></div>



<p class="wp-block-paragraph"><strong>Example:</strong>&#8211;</p>



<script src="https://gist.github.com/AdarshAshwani/9ff1bf79ef3bc011572faee7dd4520ed.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong>&#8211;</p>



<pre class="wp-block-code"><code>Display Marks: 
Array
(
    &#91;Ankit] => Array
        (
            &#91;C] => 95
            &#91;DCO] => 85
            &#91;FOL] => 74
        )

    &#91;Ram] => Array
        (
            &#91;C] => 78
            &#91;DCO] => 98
            &#91;FOL] => 46
        )

    &#91;Anoop] => Array
        (
            &#91;C] => 88
            &#91;DCO] => 46
            &#91;FOL] => 99
        )

)</code></pre>



<p class="wp-block-paragraph"><strong>Three Dimensional Array:</strong> It is a multidimensional array in its most basic form. Three-dimensional arrays have the same initialization as two-dimensional arrays. The distinction is that as the number of dimensions grows, so does the number of nested braces.</p>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">array (
    array (
        array (elements...),
        array (elements...),
        ...
    ),
    array (
        array (elements...),
        array (elements...),
        ...
    ),
    ...
)</span></code></pre>



<p class="wp-block-paragraph"><strong>Example:</strong></p>



<script src="https://gist.github.com/AdarshAshwani/bdd19a69b569ce65caae06205c223661.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Array
(
    &#91;0] => Array
        (
            &#91;0] => Array
                (
                    &#91;0] => 1
                    &#91;1] => 2
                )

            &#91;1] => Array
                (
                    &#91;0] => 3
                    &#91;1] => 4
                )

        )

    &#91;1] => Array
        (
            &#91;0] => Array
                (
                    &#91;0] => 5
                    &#91;1] => 6
                )

            &#91;1] => Array
                (
                    &#91;0] => 7
                    &#91;1] => 8
                )

        )

)</code></pre>



<p class="wp-block-paragraph"><strong>Accessing multidimensional array elements:</strong> In PHP, there are primarily two methods for accessing multidimensional array items.</p>



<ul class="wp-block-list"><li>Dimensions such as array name[‘first dimension&#8217;][‘second dimension&#8217;] can be used to retrieve elements.</li><li>The for loop can be used to access elements.</li><li>The for each loop may be used to access elements.</li></ul>



<p class="wp-block-paragraph"><strong>Example:</strong></p>



<script src="https://gist.github.com/AdarshAshwani/188c90cdbe06907e8075486cd7f35455.js"></script>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img decoding="async" width="198" height="119" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/image-43.png" alt="" class="wp-image-7466"/></figure></div>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/complete-tutorial-of-multidimensional-array/">Complete Tutorial of Multidimensional Array</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/complete-tutorial-of-multidimensional-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
