最新下载
热门教程
- 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"; //输出结果
}
相关文章
- 青云诀之伏魔怎么注销账号 账号注销流程一览 12-30
- 樱花动漫最新版本安卓下载-樱花动漫最新版本官网免费下载 12-30
- 青云诀之伏魔怎么玩战力升得快 战力快速提升攻略 12-30
- QQ邮箱一键登录入口-QQ邮箱官网极速登录直达 12-30
- 青云诀之伏魔激活码哪些可以用 12月最新可用兑换码汇总 12-30
- 羊蹄山之魂头盔一览上篇 羊蹄山之魂头盔图鉴 12-30