<?php
$url = 'https://nilpointer.net';
$str = file_get_contents($url);
$student = json_decode($str, true);
print_r($student);
echo '<br>id: '.$student['id'];
echo '<br>name: '.$student['name'];
echo '<br>age: '.$student['age'];
?>
Output
Array ( [id] => st01 [name] => Name 1 [age] => 20 )
id: st01
name: Name 1
age: 20