How to declare an array in PHP?

Posted by Editorial Staff | Updated on

What is an Array?

AnĀ array is a special variable, which can hold more than one value at a time. An array stores multiple values in one single variable.

There are three types of arrays:

  • Indexed arrays
  • Associative arrays
  • Multidimensional arrays

How to declare an array in PHP?

Following is the an example of array in PHP:

Output


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers