Hàm getervbyport () trong PHP
Thí dụ
Một ví dụ getervbyport ():
<?php
$intservname = getservbyport(80, "tcp");
echo $intservname;
?>
Định nghĩa và Cách sử dụng
Hàm getervbyport () 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ả lại: | Tên dịch vụ Internet thành công |
---|---|
Phiên bản PHP: | 4.0+ |
❮ Tham chiếu mạng PHP