04-19-2016, 05:43 AM
I made that some time ago for a website, although for spigot, but it's just an implementation of the minecraft ping protocol. I used this library (ping "version") https://github.com/xPaw/PHP-Minecraft-Query. You can aquire the online players with $Query->Query()["players"]["online"] (i saved the result of $Query->Query() in the variable $result, then closed the connection. After that checked if ($result) which checks if the host is online (otherwise result would he empty I think) and then accessed$result["players"]["online"]
I wish you good luck!
I wish you good luck!