<?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>php array functions - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/php-array-functions/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/php-array-functions/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Tue, 02 Aug 2022 08:58:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>php array functions - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/php-array-functions/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What are the types of arrays in PHP ?</title>
		<link>https://www.wikitechy.com/interview-questions/php/what-are-the-types-of-arrays-in-php/</link>
					<comments>https://www.wikitechy.com/interview-questions/php/what-are-the-types-of-arrays-in-php/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Tue, 02 Aug 2022 08:57:09 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[accessing array elements in php]]></category>
		<category><![CDATA[array in php example]]></category>
		<category><![CDATA[array push php]]></category>
		<category><![CDATA[associative array in php]]></category>
		<category><![CDATA[how many types array in php]]></category>
		<category><![CDATA[how many types of arrays are there]]></category>
		<category><![CDATA[indexed array in php]]></category>
		<category><![CDATA[multidimensional array in php]]></category>
		<category><![CDATA[php array functions]]></category>
		<category><![CDATA[php array length]]></category>
		<category><![CDATA[what are some examples of arrays]]></category>
		<category><![CDATA[what are the types of arrays]]></category>
		<category><![CDATA[what are the types of arrays in php]]></category>
		<category><![CDATA[what is array in php with example]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4543</guid>

					<description><![CDATA[In PHP an array is a type of data structure that allows us to store multiple elements of similar data type under a single variable thereby saving us the effort of creating a different variable for every data. Using their index or key arrays are helpful to create a list of elements of similar types, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4544" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays.png" alt="" width="1359" height="849" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays.png 1359w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-300x187.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-1024x640.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-768x480.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-390x244.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-820x512.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/types-of-arrays-1180x737.png 1180w" sizes="(max-width: 1359px) 100vw, 1359px" /></p>
<ul style="text-align: justify;">
<li>In PHP an array is a type of data structure that allows us to store multiple elements of similar data type under a single variable thereby saving us the effort of creating a different variable for every data.</li>
<li>Using their index or key arrays are helpful to create a list of elements of similar types, which can be accessed.</li>
<li>Suppose accordingly we want to store five names and print them and it can be easily done by the use of five different string variables.</li>
<li>Instead of five string variables, the number rises to a hundred, then it would be really difficult for the developer or user to create so many different variables.</li>
<li>Also using an index or a key array comes into play and helps us to store every element within a single variable and also allows easy access.</li>
<li>In PHP an array is created using array() function and basically there three types, they are</li>
</ul>
<ol style="text-align: justify;">
<li style="list-style-type: none;">
<ol>
<li>Indexed array</li>
<li>Associative array</li>
<li>Multidimensional array</li>
</ol>
</li>
</ol>
<h2 id="indexed-array" style="text-align: justify;">Indexed array</h2>
<ul style="text-align: justify;">
<li>Indexed array is represented by number which starts from 0 and we can store integer, object and string in the PHP array.</li>
<li>By default, all PHP array elements are assigned to an index number.</li>
</ul>
<h3 id="sample-code" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php  <br/>$season=array(&quot;January&quot;,&quot;February&quot;,&quot;March&quot;,&quot;April&quot;);  <br/>echo &quot;Month are: $month[0], $month[1], $month[2] and $month[3]&quot;;  <br/>?&gt;  </code></pre> </div>
<h3 id="output" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4545" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array.png" alt="" width="1115" height="158" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array.png 1115w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array-300x43.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array-1024x145.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array-768x109.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array-390x55.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/indexed-array-820x116.png 820w" sizes="(max-width: 1115px) 100vw, 1115px" /></p>
<h2 id="associative-array" style="text-align: justify;">Associative Array</h2>
<ul style="text-align: justify;">
<li>Associative arrays are similar to the indexed arrays but instead of linear storage, every value can be assigned with a user-defined key of string type.</li>
<li>In PHP we can associate name with each array elements by using =&gt; symbol.</li>
</ul>
<h3 id="sample-code-2" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">&lt;?php    <br/>$salary[&quot;Venkat&quot;]=&quot;350000&quot;;    <br/>$salary[&quot;Kishore&quot;]=&quot;450000&quot;;    <br/>$salary[&quot;Nizar&quot;]=&quot;200000&quot;;    <br/>echo &quot;Venkat salary: &quot;.$salary[&quot;Venkat&quot;].&quot;&lt;br/&gt;&quot;;  <br/>echo &quot;Kishore salary: &quot;.$salary[&quot;Kishore&quot;].&quot;&lt;br/&gt;&quot;;  <br/>echo &quot;Nizar salary: &quot;.$salary[&quot;Nizar&quot;].&quot;&lt;br/&gt;&quot;;  <br/>?&gt;    </code></pre> </div>
<h3 id="output-2" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4546" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array.png" alt="" width="1150" height="292" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array.png 1150w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array-300x76.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array-1024x260.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array-768x195.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array-390x99.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/associative-array-820x208.png 820w" sizes="(max-width: 1150px) 100vw, 1150px" /></p>
<h2 id="multidimensional-array" style="text-align: justify;">Multidimensional Array</h2>
<ul style="text-align: justify;">
<li>PHP multidimensional array is otherwise known as array of arrays and allows you to store tabular data in an array.</li>
<li>In the form of matrix PHP multidimensional array can be represented which is represented by row * column.</li>
</ul>
<h3 id="sample-code-3" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-php code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-php code-embed-code">$emp = array  <br/>  (  <br/>  array(1,&quot;Venkat&quot;,400000),  <br/>  array(2,&quot;Kishore&quot;,500000),  <br/>  array(3,&quot;Nizar&quot;,300000)  <br/>  );  </code></pre> </div>
<h3 id="output-3" style="text-align: justify;">Output</h3>
<table width="0">
<tbody>
<tr>
<td width="215">&nbsp;</p>
<p>ID</td>
<td width="215">&nbsp;</p>
<p>Name</td>
<td width="215">&nbsp;</p>
<p>Salary</td>
</tr>
<tr>
<td width="215">&nbsp;</p>
<p>1</td>
<td width="215">&nbsp;</p>
<p>Venkat</td>
<td width="215">&nbsp;</p>
<p>400000</td>
</tr>
<tr>
<td width="215">&nbsp;</p>
<p>2</td>
<td width="215">&nbsp;</p>
<p>Kishore</td>
<td width="215">&nbsp;</p>
<p>500000</td>
</tr>
<tr>
<td width="215">&nbsp;</p>
<p>3</td>
<td width="215">&nbsp;</p>
<p>Nizar</td>
<td width="215">&nbsp;</p>
<p>300000</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/php/what-are-the-types-of-arrays-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
