Oh thanks, managed to fix some forgotten ";"'s
Anyways, I also did like he said to hide this error message if it can't connect to the server:
Warning: fsockopen() [function.fsockopen]: unable to connect to 86.80.237.30:25566 (Connection timed out) in /home/roensite/public_html/sub/minecraftneo/text/onlinelist/core/inc/mc.inc.php on line 4
86.80.237.30:1337
Currently Offline!
Here's the PHP:
<?php
function fetch_server_info($ip, $port){
$socket = fsockopen($ip, $port, $errno, $errstr, 0.5);
if ($socket === false){
return false;
}
fwrite($socket, "QUERY_JSON\n");
$responce = stream_get_contents($socket);
return json_decode($responce, true);
}
?>
Anything wrong with that?