I made this long time ago, because i don't like Deathfire'D' one.
I used only SimpleXML in the whole script, so, it will works for PHP5+
<?php
function ServerStatus($ip, $port) {
$info = chr(6).chr(0).chr(255).chr(255).'info';
$sock = fsockopen($ip, $port, $errno, $errstr, 1);
if...