Comment by Mitchell McKenna on Get the first element of an array

April 1 2020, 12:37pm

Shorten with null-coalescing operator, usually null is default so: $first_value = $my_array[array_key_first($my_array)] ?? null;