[
'timeout' => 5, // seconds
'header' => "User-Agent: PHP/" . PHP_VERSION . "\r\n"
]
]);
$json = @file_get_contents($apiUrl, false, $context);
if ($json === false) {
die('
Could not fetch data from the API.
');
}
$data = json_decode($json, true);
if ($data === null) {
die('
Malformed JSON returned from the API.
');
}
function h(string $s): string
{
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
}
?>
System Properties
- = h($prop['Property']); ?>
Components
= h($comp['component_name']); ?>