How can you split the first field of an associative array into $key and $value without looping through the entire array in PHP?

To split the first field of an associative array into $key and $value without looping through the entire array in PHP, you can use the array_shift() function to extract the first element of the array and then use the key() and current() functions to separate the key and value.

$firstElement = reset($array);
$key = key($firstElement);
$value = current($firstElement);