最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php中 getservbyport getservbyname函数实例
时间:2022-06-24 20:12:01 编辑:袖梨 来源:一聚教程网
string getservbyport ( int $port , string $protocol )
*/
$services=array('80','21','22','23','25','143'); //定义数组
foreach($services as $service) //循环读取内容
{
$protocol=getservbyport($service,'tcp'); //返回端口号对应的协议
echo $service.":".$protocol."
n"; //输出结果
}
/*
int getservbyname ( string $service , string $protocol )
*/
$services=array('http','ftp','ssh','telnet','imap',
'smtp','nicname','gopher','finger','pop3','www'); //定义一个数组
foreach($services as $service) //循环读取内容
{
$port=getservbyname($service,'tcp'); //获取数组元素对应端口
echo $service.":".$port."
n"; //输出结果
}
相关文章
- 《夜族崛起》铁匠西里尔位置一览 05-17
- 《寓言之地》1.02更新内容一览 05-17
- 《辐射4》steam好评率介绍 05-17
- 《夜族崛起》技能强化珠宝掉落说明 05-17
- 《辐射4》主机控制台介绍 05-17
- 《星露谷物语》海草和绿藻获取方法 05-17