How to get the first item from an associative PHP array?
Suppose I have the following associative array:

```php
$array = array(
    "foo" => "bar1",
    "baz" => "qux1",
    "qux" => "qux2",
    "foo" => "bar2",
);
```

To get the value of the first occurrence of the key `"foo"`, you can use the `array_shift()
To get the first item from an associative array in PHP, you cannot rely solely on its index due to the fact that it doesn't have a numeric key associated. Instead, you must look for the specific key that you want to access. Here's a code example using the array_shift() function:

```php
<?php
$myArray = array(
    "apple" => 2,
    "banana" => 3