,

What are the types of Array in PHP? Plz provide an explanation with an example.

Posted by

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

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