- class
NetAddress(php\net\NetAddress) - package
std - source
php/net/NetAddress.php
Description
Class NetAddress
NetAddress ::getAllByName()NetAddress ::getByAddress()NetAddress ::getLoopbackAddress()- Returns the loopback address.NetAddress ::getLocalHost()- Returns the address of the local host. This is achieved by retrieving
->__construct()- Determines the IP address of a host, given the host's name.->hostName()- Gets the host name for this IP address.->hostAddress()- Returns the IP address string in textual presentation.->address()- Returns the raw IP address of this NetAddress->canonicalHostName()- Gets the fully qualified domain name for this IP address.->__toString()->isReachable()- Test whether that address is reachable. Best effort is made by the->isSiteLocalAddress()->isMulticastAddress()->isAnyLocalAddress()->isLoopbackAddress()->isLinkLocalAddress()->isMCGlobal()->isMCNodeLocal()->isMCLinkLocal()->isMCSiteLocal()->isMCOrgLocal()
NetAddress::getAllByName(string $host): NetAddress[]NetAddress::getByAddress(int[] $address): NetAddressNetAddress::getLoopbackAddress(): NetAddressReturns the loopback address.
The NetAddress returned will represent the IPv4 loopback address, 127.0.0.1, or the IPv6 loopback address, ::1. The IPv4 loopback address returned is only one of many in the form 127...*
NetAddress::getLocalHost(): NetAddressReturns the address of the local host. This is achieved by retrieving the name of the host from the system, then resolving that name into an NetAddress.
__construct(string $host): voidDetermines the IP address of a host, given the host's name.
hostName(): stringGets the host name for this IP address.
hostAddress(): stringReturns the IP address string in textual presentation.
address(): int[]Returns the raw IP address of this NetAddress object. The result is in network byte order: the highest order byte of the address is in address()[0].
canonicalHostName(): stringGets the fully qualified domain name for this IP address. Best effort method, meaning we may not be able to return the FQDN depending on the underlying system configuration.
__toString(): stringisReachable(int $timeout): boolTest whether that address is reachable. Best effort is made by the implementation to try to reach the host, but firewalls and server configuration may block requests resulting in a unreachable status while some specific ports may be accessible. A typical implementation will use ICMP ECHO REQUESTs if the privilege can be obtained, otherwise it will try to establish a TCP connection on port 7 (Echo) of the destination host.
isSiteLocalAddress(): boolisMulticastAddress(): boolisAnyLocalAddress(): boolisLoopbackAddress(): boolisLinkLocalAddress(): boolisMCGlobal(): boolisMCNodeLocal(): boolisMCLinkLocal(): boolisMCSiteLocal(): boolisMCOrgLocal(): bool