Arrays store multiple values in one variable. PHP supports indexed arrays like $colors[0] and associative arrays like $person['name']. Loop through them with foreach and use built-in functions like sort() and array_filter().
Array Functions
$a = [3, 1, 4, 1, 5, 9, 2, 6];
count($a); // 8
array_sum($a); // 31
array_unique($a); // [3,1,4,5,9,2,6]
sort($a); // sort ascending
rsort($a); // sort descending
in_array(5, $a); // true/false
array_search(5, $a); // returns key/false
array_push($a, 7); // add to end
array_pop($a); // remove from end
array_shift($a); // remove from start
array_unshift($a, 0); // add to start
array_reverse($a); // reverse
array_slice($a, 1, 3); // extract portion
array_splice($a, 1, 2); // remove and return
array_merge($a, [10,11]); // merge arrays
array_keys($a); // all keys
array_values($a); // all values
array_flip($a); // swap keys and values
array_chunk($a, 3); // split into chunks of 3
implode(", ", $a); // join as string
explode(",","a,b,c"); // split string to array