Mojang Status
Controlla lo stato dei servizi di Mojang.

A PHP Error was encountered

Severity: Warning

Message: foreach() argument must be of type array|object, null given

Filename: personal/mojang-status.php

Line Number: 26

Backtrace:

File: /home/lucapatera/web/lucapatera.it/public_html/application/views/projects/personal/mojang-status.php
Line: 26
Function: _error_handler

File: /home/lucapatera/web/lucapatera.it/public_html/application/controllers/Pages.php
Line: 94
Function: view

File: /home/lucapatera/web/lucapatera.it/public_html/index.php
Line: 315
Function: require_once

Codice PHP:
<?php
$url = "http://status.mojang.com/check";
print($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$html= json_decode($res,true);
foreach($html as $item)
{
  $nome= array_keys($item);
  $valore= array_values($item);

  echo $nome[0]." > ".$valore[0]."<br>";
}
?>