- var_dump: documentation ( source)
- json_decode: documentation ( source)
- stream_get_contents: documentation ( source)
- fclose: documentation ( source)
- fopen: documentation ( source)
<?php
$variable1 = fopen("https://en.wikipedia.org/w/api.php?action=query&prop=pageimages&format=json&piprop=original&titles=Tomoyasu_Hotei", "r");
$variable2 = stream_get_contents($variable1);
fclose($variable1);
$variable3 = json_decode($variable2, true);
$variable4 = $variable3["query"]["pages"];
echo "<pre>";
var_dump($variable4);
echo "</pre>";