Dzisiaj natknąłem się na skrypt pozwalający zobaczyć, czy dany serwer jest online na danym porcie, jednak nie wiem czemu, "echo" jakby nie działało. Jest po prostu pusto po wykonaniu skryptu przez bbcode.
Skrypt:
<?php
// use fsocketopen to check if port is in use or not.
// www.host.com < = address | no protocol is needed.
// 25565 < = minecraft server port. Change if you actually
// run the server on a different port (doubt)
// the last value in the function '1', timeout duration, in seconds.
$mcport = @fsockopen("www.host.com", 25565, $errno, $errstr, 1);
// if the port is not in use
if (!$mcport) {
// show that it is offline
echo "Offline";
} else {
// or if it is in use, show online.
echo "Online";
}
?>