Arrays are one of the most important data structures in PHP. They can hold multiple values in a single variable.
Indexed Arrays
Use numeric indexes (starting from 0) to access elements.
Associative Arrays
Use named keys (strings) instead of numeric indexes — like a dictionary or map.
Creating Arrays
$arr = [];or$arr = array();$arr = [1, 2, 3];— Indexed$arr = ["name" => "Ali", "age" => 25];— Associative
Common Array Operations
count()— Count elementsarray_push()— Add to endarray_merge()— Combine arraysarray_keys()— Get all keysarray_values()— Get all values