PHP getservbyport()ฟังก์ชัน
ตัวอย่าง
ตัวอย่าง getservbyport()
<?php
$intservname = getservbyport(80, "tcp");
echo $intservname;
?>
ความหมายและการใช้งาน
ฟังก์ชัน getservbyport() ส่งคืนบริการอินเทอร์เน็ตสำหรับพอร์ตและโปรโตคอลที่กำหนด
ไวยากรณ์
getservbyport(port, protocol)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
port | Required. Specifies the port number (like 80) |
protocol | Required. Specifies a protocol name (like "tcp" or "udp") |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ชื่อบริการอินเทอร์เน็ตบนความสำเร็จ |
---|---|
รุ่น PHP: | 4.0+ |
❮ การอ้างอิงเครือข่าย PHP