Bir dosya oluşturup içine bu kodları yerleştirmeniz yeterli olacaktır. Sonrasında tarayıcınızdan o sayfayı açın.

<?php
echo ping("IP ADRESI","PORT","6");

function ping($host,$port,$timeout)
{
        $fsock = fsockopen($host, $port, $errno, $errstr, $timeout);
        if ( !$fsock )
        {
                return "HATA";
        }
        else
        {
                return "TAMAM";
        }
}
?>