🔸 فانکشن موردنیاز :
function oghab_tm($host, $port, $timeout)
{
$tB = microtime(true);
$fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
if (!$fP) { return "down"; }
$tA = microtime(true);
return round((($tA - $tB) * 1000), 0)." ms";
}🔹 حالا از فانکشن استفاده میکنیم (اگر به هر دلیلی عملیات شکست خورد کلمه
Down چاپ میشود!)echo oghab_tm("google.com", 80, 10);🆔: @Star_Sourcee