How can the issue of multiple variable usage in the code be resolved?

Issue: The problem of multiple variable usage in the code can be resolved by using arrays or objects to store related data instead of creating multiple variables. This approach helps in organizing and managing data more efficiently, reduces the chances of naming conflicts, and improves code readability.

// Using an array to store related data
$user = [
    'name' => 'John Doe',
    'age' => 30,
    'email' => 'john.doe@example.com'
];

echo $user['name']; // Output: John Doe
echo $user['age']; // Output: 30
echo $user['email']; // Output: john.doe@example.com