'https://example.com'], ['url' => 'https://example.com/does-not-exist-hopefully'], ]; foreach ($targets as $t) { $r = check_http_head($t['url']); echo $t['url'], " => ", ($r['ok'] ? 'UP' : 'DOWN'), " code=", ($r['code'] ?? 'null'), " ms=", ($r['ms'] ?? 'null'); if (!empty($r['error'])) { echo " error=", $r['error']; } echo PHP_EOL; }