Hàm getservbyport() trong PHP
Ví dụ
Một ví dụ getservbyport():
<?php
$intservname = getservbyport(80, "tcp");
echo $intservname;
?>
Định nghĩa và cách sử dụng
Hàm getservbyport() trả về dịch vụ Internet cho một cổng và giao thức nhất định.
Cú pháp
getservbyport( port, protocol )
Giá trị tham số
Parameter | Description |
---|---|
port | Required. Specifies the port number (like 80) |
protocol | Required. Specifies a protocol name (like "tcp" or "udp") |
Chi tiết kỹ thuật
Giá trị trả về: | Tên dịch vụ Internet thành công |
---|---|
Phiên bản PHP: | 4.0+ |
❮ Tham chiếu mạng PHP