,

List types of arrays available in PHP. explain with example

Posted by

Types of an array in Php

There are three types of Array in PHP with examples.

Numeric/Indexed Array – In this array index will be represented by a number or integer. By default, its index begins from 0.

Ex: - $num [0] = “Mohit”;

Associative Array – In this Array index/key will be represented by a string value.

Ex: - $fees [“Mohit”] = 800;

Multidimensional Array – Arrays of Arrays come under the category of multidimensional arrays. This is called multidimensional arrays.

Ex: - $num [0] [0] = 29;
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x