hey thanks for the help but its still wont connect! <?php
[php]/**
*
class Server
{
public $host;
public $port;
public function __construct($host, $port = 25565)
{
$this->port = (int)($port);
if(preg_match('/:\d+$/', $host)) {
if(preg_match('/:\/\//', $host))
{
list($protocol, $this->host, $this->port) = explode(':', str_replace('//', '', $host));
}
else
{
list($this->host, $this->port) = explode(':', $host);
}
}
else
{
$this->host = $host;
}
}
public function info()
{
$header = stream_socket_client(‘tcp://’.$this->host.’:’.$this->port, $errno, $errstr, 45);
$stats = array(
'online'=>false,
'version'=>false,
'players'=>false,
'max'=>false,
);
if (!$header)
return $stats;
fwrite($header, "\xfe\x01");
$info = fread($header, 1024);
fclose($header);
if(!$info)
return $stats;
$info = substr($info, 9);
$info = mb_convert_encoding($info, 'auto', 'UCS-2');
$info = explode("\x00", $info);
$stats['online'] = true;
list($stats['protocol'], $stats['version'], $stats['name'], $stats['players'], $stats['max']) = $info;
return $stats;
}
}
[/php]
thats the entire code,
it still just says connection refused, the website is tyriancraft.com and its for a minecraft server, any help would be appreciated 