If user access my page using an ID: `mysite.com/page.php?id=3`, I want the PHP to check if ID is defined in an array, if true, it returns in page multiple user information from same array according to their defined IDs.

My code:

```
$userinfo = [
        ['id' => 3, 'name' => 'username3', 'phone' => '3333'],
        ['id' => 2, 'name' => 'username2', 'phone' => '2222'],
        ['id' => 1, 'name' => 'username1', 'phone' => '1111']
    ];  

if (isset($_GET['id']) && isset($userinfo[$_GET['id']])) {
     $name = $userinfo[$_GET['name']]; // If I access PHP with '?id=3' wanna 'username3'.
     $phone = $userinfo[$_GET['phone']]; // It stores id 3 user phone: '3333'
    }

echo $name; // It returns 'name' from array.
echo $phone; // It returns 'phone' from array.

```

It's only a base, I know it don't works, any help with the code? thanks in advance.