How can you transform associative keys into numerical indices in PHP arrays for better organization?

When working with associative arrays in PHP, it can be beneficial to transform the associative keys into numerical indices for better organization and easier access to elements. One way to achieve this is by using the array_values() function in PHP, which returns all the values of an array as a new indexed array.

$associativeArray = array(
    'key1' => 'value1',
    'key2' => 'value2',
    'key3' => 'value3'
);

$indexedArray = array_values($associativeArray);

print_r($indexedArray);