I am trying to display data from multiple `JSON` files using an `array`.

When using the code below, only the data from the last file in the array is displayed. How do I ensure that the data from all the files in the array are displayed?

If I change the order of the JSON files, still only the data from the last file in the array is displayed.

The array:

```
$homepage   = array();
$homepage[] = "http://linktojson.com/1/";
$homepage[] = "http://linktojson.com/2/";
$homepage[] = "http://linktojson.com/3/";
$homepage[] = "http://linktojson.com/4/";
$homepage[] = "http://linktojson.com/5/";

```

I then get the contents from the files in the array and decode it:

```
foreach ($homepage as $homepage2) {
    $data = json_decode(file_get_contents($homepage2, false));
}

```

And finally the value `ID` from each of the files in the array is echoed:

```
foreach ($data->Content->Catalog as $each) {
    echo $each->ID;
}

```