This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ping($host, $port=25565, $timeout=30) { | |
//Set up our socket | |
$fp = fsockopen($host, $port, $errno, $errstr, $timeout); | |
if (!$fp) return false; | |
//Send 0xFE: Server list ping | |
fwrite($fp, "\xFE"); | |