How can you improve your understanding of array manipulation in PHP to avoid confusion when accessing values by keys?

When working with arrays in PHP, it's important to be mindful of the difference between accessing array values by keys and by numerical indexes. To avoid confusion, make sure to use the correct syntax when accessing values by keys, especially when dealing with associative arrays. Additionally, familiarize yourself with array manipulation functions in PHP to efficiently work with arrays.

// Example of correctly accessing values by keys in an associative array
$person = [
    'name' => 'John Doe',
    'age' => 30,
    'city' => 'New York'
];

// Accessing values by keys
echo $person['name']; // Output: John Doe
echo $person['age']; // Output: 30
echo $person['city']; // Output: New York