PHP 8.3.4 Released!

getservbyport

(PHP 4, PHP 5, PHP 7, PHP 8)

getservbyportBelirtilen port ve protokolle ilgili ağ hizmeti ile döner

Açıklama

getservbyport(int $port, string $protokol): string|false

getservbyport() işlevi belirtilen protokol için /etc/services dosyasında port ile ilişkilendirilmiş ağ hizmetini döndürür.

Bağımsız Değişkenler

port

Port numarası.

protokol

protokol olarak "tcp" veya "udp" (küçük harflerle) belirtilebilir.

Dönen Değerler

Ağ hizmetinin ismini bir dizge olarak, başarısızlık durumunda false döner.

Ayrıca Bakınız

  • getservbyname() - Belirtilen ağ hizmeti ve protokolle ilişkili port numarası ile döner

add a note

User Contributed Notes 1 note

up
1
paland at stetson dot edu
23 years ago
Example:
<?php $value = getservbyport(137, "udp"); ?>

The same goes for getservbyname()
To Top