PHP's array is a versatile ordered map that doubles as a list, and the language provides many built-in functions for transforming and querying them. array_map() applies a callback to each element and returns a new array, making it the canonical way to transform collections, often paired with arrow functions such as fn($n) => $n * 2. For combining arrays, you can use array_merge(), which re-indexes numeric keys, or the spread operator [...$a, ...$b] introduced in PHP 7.4, which performs the same job inline. With string keys, both approaches let later values overwrite earlier ones.
Filtering and reduction are equally important. array_filter() returns elements for which the supplied callback returns true, and when called without a callback it removes any value considered falsy. array_reduce() collapses an array to a single value by feeding each element through a callback that updates a running carry, perfect for summing numbers, building a string, or accumulating complex state. When you need to check membership, in_array() searches for a value while array_key_exists() searches for a key, and you can pass true as in_array's third argument to compare values strictly with the same rules as the === operator.
String manipulation is just as central. explode() splits a string into an array around a delimiter, and implode() does the inverse, joining array elements into a string with a chosen glue. PHP 8 introduced three highly readable helpers: str_contains() checks for a substring, str_starts_with() checks a prefix, and str_ends_with() checks a suffix, all returning booleans. For formatted output, sprintf() returns a string built from placeholders such as %s for strings, %d for integers, and %f for floats, allowing precise control over the final text without resorting to concatenation.