What is the best way to access and use arrays obtained from a website via HTTP request in PHP?

When accessing arrays obtained from a website via HTTP request in PHP, the best way is to use the `json_decode` function to convert the JSON response into a PHP array. This allows you to easily access and manipulate the data within the array.

<?php
$url = 'https://example.com/api/data';
$response = file_get_contents($url);
$data = json_decode($response, true);

// Access the array elements
foreach ($data as $item) {
    echo $item['key'] . ': ' . $item['value'] . '<br>';
}
?>