What is the best way to extract a list of array names from an array in PHP?

To extract a list of array names from an array in PHP, you can use the `array_keys()` function to get an array of all the keys in the original array. This will give you the list of array names.

$array = [
    'name' => 'John',
    'age' => 30,
    'city' => 'New York'
];

$keys = array_keys($array);

print_r($keys);