,

What are the types of Array in PHP? Plz provide an explanation with an 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. By default numeric array index start from 0.

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

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

Ex: - $fees [“Rahul”] = 500;

Multidimensional Array – Arrays of Arrays is known as multidimensional arrays.

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

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