How can arrays be used to handle multiple variables in PHP?

Arrays in PHP can be used to handle multiple variables by storing them in a single variable. This allows for easier organization and manipulation of data. To use arrays for multiple variables, simply create an array variable and assign values to it using keys. This way, you can access each variable by referencing its key within the array.

// Using arrays to handle multiple variables
$person = array(
    'name' => 'John',
    'age' => 30,
    'city' => 'New York'
);

echo $person['name']; // Output: John
echo $person['age']; // Output: 30
echo $person['city']; // Output: New York