1. 程式人生 > >PHP 埠掃描工具

PHP 埠掃描工具

在這裡插入圖片描述

$arr = [80,8080,3306];
foreach ($arr as $port) {
    $fp = @fsockopen('172.29.159.198',$port,$errno,$errstr,0.1);
    if (!$fp) {
        echo $port." closed\n";
    }else{
        echo $port." Opend\n";
    }
}