An array is a way to store multiple values together in a single variable, commonly used in programming languages like PHP — the language WordPress itself is built with.
Instead of creating separate variables for every item, an array groups related values into one organized list you can loop through or access individually.
A Simple Example
$colors = array( "red", "green", "blue" );
echo $colors[0]; // outputs "red"
Here, $colors holds three separate values in one variable. Each item has a position, called an index, starting at 0 — which is why $colors[0] returns “red,” the first item in the list.
Where Arrays Show Up in WordPress
Arrays are everywhere in WordPress development. Plugin settings, post query results, and menu items are all commonly stored and passed around as arrays behind the scenes, even if you never see the raw code as a site owner.