REST-API Beispiel in PHP

<!-- Liste mit kostenlosen APIs: https://mixedanalytics.com/blog/list-actually-free-open-no-auth-needed-apis/ -->
<html>
<body>
<?php
$name = 'Elon';
$response = file_get_contents('https://api.agify.io?name=' . $name);
$response = json_decode($response, true);
echo $name . " ist im Durchschnitt " . $response['age'] . " Jahre alt.";
?>
</body>
</html>