この関数をcronジョブから実行するように変換してから、返されたデータをデータベースに挿入する方法はありますか?
public function ping($host, $port=25565, $timeout=0.1) {
//Set up our socket
    $beginning_time = microtime(true);
    $fp = fsockopen($host, $port, $errno, $errstr, $timeout);
    if (!$fp) return false;
    $end_time = microtime(true);
//Send 0xFE: Server list ping
    fwrite($fp, "\xFE");
//Read as much data as we can (max packet size: 241 bytes)
    $d = fread($fp, 256);
//Check we've got a 0xFF Disconnect
    if ($d[0] != "\xFF") return false;
//Remove the packet ident (0xFF) and the short containing the length of the string
    $d = substr($d, 3);
//Decode UCS-2 string
    $d = mb_convert_encoding($d, 'auto', 'UCS-2');
//Split into array
    $d = explode("\xA7", $d);
//Return an associative array of values
    return array(
        'motd'        =>        $d[0],
        'players'     => intval($d[1]),
        'max_players' => intval($d[2]),
        'latency'     => ($end_time - $beginning_time) * 1000);
}
返されるデータは、最後の配列にあるものです。