ip2long
���������� ����������� ������ ������ IPv4 � �����.
��������� :
int ip2long(string ip_address);
������� ip2long() ���������� ��������������� ��������� ������������� ������ IP v4 �� ������ (�����, ����������� �������, ��������: "127.0.0.1").
���������� ����������� ������ ������ IPv4 � �����.
��������� :
int ip2long(string ip_address);
������� ip2long() ���������� ��������������� ��������� ������������� ������ IP v4 �� ������ (�����, ����������� �������, ��������: "127.0.0.1").
// �������� IP ����� ����� $ip=gethostbyname("www.php.net"); echo "��������� URL ������������:<br>"; echo "https://www.php.net/, https://".$ip. "/, � https://".ip2long($ip)."/<br>";
long2ip
���������� ����������� ����� � ������ ������ IP v4.
��������� :
string long2ip(int proper_address);
������� long2ip() ���������� ��������� ������������� IP-������ (� �������: "aaa.bbb.ccc.ddd") �� ���������� �������������.
���������� ����������� ����� � ������ ������ IP v4.
��������� :
string long2ip(int proper_address);
������� long2ip() ���������� ��������� ������������� IP-������ (� �������: "aaa.bbb.ccc.ddd") �� ���������� �������������.
gethostbyaddr
���������� ��� �����, ������� ������������� ��������� IP-������.
��������� :
string gethostbyaddr(string ip_address);
������� gethostbyaddr() ���������� �������� ��� �����, ��������� ����� IP-�������. � ��������� ����������� ����� IP � ��������� �������. � ������ ������ ���������� ip_address.
���� ��������, ��� ������� �� �����������, ��� ���������� ��� �� ����� ���� ����� ��������������� ����������������. ��� ���� ���������� ���� �� ������ ip_address � ������ ��� �������� ���� ���. �������� �����, ����� �������, ����� ���������� ���, ��� ��� �����������������.
���������� ��� �����, ������� ������������� ��������� IP-������.
��������� :
string gethostbyaddr(string ip_address);
������� gethostbyaddr() ���������� �������� ��� �����, ��������� ����� IP-�������. � ��������� ����������� ����� IP � ��������� �������. � ������ ������ ���������� ip_address.
���� ��������, ��� ������� �� �����������, ��� ���������� ��� �� ����� ���� ����� ��������������� ����������������. ��� ���� ���������� ���� �� ������ ip_address � ������ ��� �������� ���� ���. �������� �����, ����� �������, ����� ���������� ���, ��� ��� �����������������.
echo gethostbyaddr("127.0.0.1");
gethostbyname
���������� IP-����� �����.
��������� :
string gethostbyname(string hostname);
������� gethostbyname() �������� � ���������� �������� ��� ����� � ���������� ��� IP-�����. ���� ����� ���������� �� �������, ������� ���������� hostname.
���������� IP-����� �����.
��������� :
string gethostbyname(string hostname);
������� gethostbyname() �������� � ���������� �������� ��� ����� � ���������� ��� IP-�����. ���� ����� ���������� �� �������, ������� ���������� hostname.
gethostbynamel
���������� ������ IP-������� �����.
��������� :
array gethostbynamel(string hostname);
������ ��������� ����� ����� ��������������� ����� ��������� IP-�������, � � ������ ������� ������������� �������� DNS-������ ��� ��������, �� ������ IP-������ ������������� ������. �� �������� ��� �����, ������� ������������� �������� �����.
������� gethostbynamel() ���������� �� ����, � ��� IP-������ ����� � ������ hostname.
����� ��������, ��� � ��������� ���������� ��������� ����������� ������, ������� ����� ��������� �������� �����, �� ���� � ��� �� IP-������. ����� �������, ���� ��������� ������������������ ������ ��� ������������� ����� � IP-������� ip ������ �������� ���� �� �����:
���������� ������ IP-������� �����.
��������� :
array gethostbynamel(string hostname);
������ ��������� ����� ����� ��������������� ����� ��������� IP-�������, � � ������ ������� ������������� �������� DNS-������ ��� ��������, �� ������ IP-������ ������������� ������. �� �������� ��� �����, ������� ������������� �������� �����.
������� gethostbynamel() ���������� �� ����, � ��� IP-������ ����� � ������ hostname.
����� ��������, ��� � ��������� ���������� ��������� ����������� ������, ������� ����� ��������� �������� �����, �� ���� � ��� �� IP-������. ����� �������, ���� ��������� ������������������ ������ ��� ������������� ����� � IP-������� ip ������ �������� ���� �� �����:
$host = gethostbyaddr($ip); echo gethostbyname($host);�� ����������� ������������������ ��� ������ � DNS-������ $host, ��������, ����� ���������� �� �� �� ���, � ������:
$ip = gethostbyname($host); echo gethostbyaddr($ip);
getprotobyname
���������� ����������� ������ �����, ������������� ����������.
��������� :
int getprotobyname(string name);
���������� ����������� ������ �����, ������������� ����������.
��������� :
int getprotobyname(string name);
getprotobynumber
���������� ����������� ��������� �����.
��������� :
string getprotobynumber(int number);
���������� ����������� ��������� �����.
��������� :
string getprotobynumber(int number);
getservbyname
���������� ����������� ��������� ��������-������.
��������� :
int getservbyname(string service, string protocol);
��� ������� ���������� ����� �����, ������� ���������� ������ service.
� ��������� protocol ����������� ��� ��������� - TCP ��� UDP.
���������� ����������� ��������� ��������-������.
��������� :
int getservbyname(string service, string protocol);
��� ������� ���������� ����� �����, ������� ���������� ������ service.
� ��������� protocol ����������� ��� ��������� - TCP ��� UDP.
echo getservbyname("HTTP", "TCP"); // ����� ������� 80
getservbyport
���������� ����������� ��������-������, ������� ���������� �������� ����.
��������� :
string getservbyport(int port, string protocol);
����� � ��������� protocol ����� ������� ��� ��������� - TCP ���� UDP.
���������� ����������� ��������-������, ������� ���������� �������� ����.
��������� :
string getservbyport(int port, string protocol);
����� � ��������� protocol ����� ������� ��� ��������� - TCP ���� UDP.
echo getservbyport(21, "TCP"); // �������: ftp echo getservbyport(23, "TCP"); // �������: telnet
checkdnsrr
���������� �������� ������ DNS.
��������� :
int checkdnsrr(string host [, string type]);
��� ������� ���������� ������ DNS-������� ��� ������ �������, ������� ������� ��� ����� host. ���� ���� ������� ������ ���� type, �� ������� ���������� true. � ��������� ������ � ��� ������ - false.
�������� type����� ��������� ��������:A
MX (�� ���������)
NS
SOA
PTR
CNAME
ANY
�������� host ����� ����������� ������� � ������� IP � ����������� �������, ���� ���� ������ �����.
���������� �������� ������ DNS.
��������� :
int checkdnsrr(string host [, string type]);
��� ������� ���������� ������ DNS-������� ��� ������ �������, ������� ������� ��� ����� host. ���� ���� ������� ������ ���� type, �� ������� ���������� true. � ��������� ������ � ��� ������ - false.
�������� type����� ��������� ��������:
�������� host ����� ����������� ������� � ������� IP � ����������� �������, ���� ���� ������ �����.
getmxrr
���������� ��������� MX ������ ��� ��������-�����.
��������� :
int getmxrr(string hostname, array mxhosts [, array weight]);
������� getmxrr() ���������� ����� � ���� ������ DNS ������ MX (�������� ������ ������) ��� ����� hostname.
���� ������ �������, ���������� true, ���� ��� - �� false.
������ ������� MX ��������� � ������ mxhosts. ���� ������ ������ weight, �� ����������� �������������� ����������� � �������.
���������� ��������� MX ������ ��� ��������-�����.
��������� :
int getmxrr(string hostname, array mxhosts [, array weight]);
������� getmxrr() ���������� ����� � ���� ������ DNS ������ MX (�������� ������ ������) ��� ����� hostname.
���� ������ �������, ���������� true, ���� ��� - �� false.
������ ������� MX ��������� � ������ mxhosts. ���� ������ ������ weight, �� ����������� �������������� ����������� � �������.