How can PHP arrays be utilized more effectively to streamline the code and improve readability in the given scenario?

The issue in the given scenario is that the code contains repetitive lines for setting and accessing values in an array. To streamline the code and improve readability, we can utilize PHP arrays more effectively by using key-value pairs to store and retrieve data in a more organized manner.

// Using PHP arrays with key-value pairs to streamline code and improve readability
$data = [
    'name' => 'John Doe',
    'age' => 30,
    'email' => 'johndoe@example.com'
];

// Accessing data from the array
echo 'Name: ' . $data['name'] . '<br>';
echo 'Age: ' . $data['age'] . '<br>';
echo 'Email: ' . $data['email'] . '<br>';