����������
WEB - ������

www.spravkaweb.ru Rambler's Top100
 ï¿½ï¿½ ����������: �������/PHP/������� �������.Ðàñïå÷àòàòü 
�������
�������
����� ���
HTML
JavaScript
VBScript
CSS
Flash
Perl
PHP
MySQL
SSI
VRML
�������������
������
Download
�����
��������
������
�������� ���
�����:
��������
Subscribe.Ru:

PHP

<--����� | ��������� � ������ | ������-->
������� �������
ip2long
���������� ����������� ������ ������ 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") �� ���������� �������������.

gethostbyaddr
���������� ��� �����, ������� ������������� ��������� 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.

gethostbynamel
���������� ������ 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);

getprotobynumber
���������� ����������� ��������� �����.

��������� :
string getprotobynumber(int number);

getservbyname
���������� ����������� ��������� ��������-������.

��������� :
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.
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 � ����������� �������, ���� ���� ������ �����.

  • getmxrr
    ���������� ��������� MX ������ ��� ��������-�����.

    ��������� :
    int getmxrr(string hostname, array mxhosts [, array weight]);

    ������� getmxrr() ���������� ����� � ���� ������ DNS ������ MX (�������� ������ ������) ��� ����� hostname.
    ���� ������ �������, ���������� true, ���� ��� - �� false.

    ������ ������� MX ��������� � ������ mxhosts. ���� ������ ������ weight, �� ����������� �������������� ����������� � �������.
    �� ���������� ����� ����� ������� "PHP 4. ����������� ����������."
    www.piter.com
    ������ / � ����������
     
    Download
    Ñêà÷àòü ñïðàâî÷íèê ïî PHP
    ��� ������:
    05.07.2004
  • � ������� PHP ��������� ��������� ������� ��� ������ � ���������� (���������� GD):
    imagetypes(), ...
  • � ������� JavaScript ��������� �������� �� ����� D, E, F, H, I
  • � ������� ������ ��������� ������, �������������� ��� �������� � html-�������� ��������� MS Office (Word, Excel � �.�.)
  • �����������:
    ��� ��� ������ ����� �� �������� � �����������:
    ��� ��������.
    ������ �� ��������.
    ���� ��������.
    �������� �������� �������.
    �� ��� ������� �������.
    � ����������� ���� ������.
    � ��� ��� �����.
    ������.
    ��������:
    Rambler's Top100
    Ñäåëàòü ñòðàíèöó ñòàðòîâîé ������� �������� ���������
    Äîáàâèòü ñòðàíèöó â èçáðàííîå �������� ���� � ���������
    Ñîîáùèòü îá íàéäåííîé îøèáêå �������� �� ������