Network Information Functions In PHP

February 24th, 2008 | by programming |

1.
string gethostbyaddr ( string $ip_address )

Returns the host name of the Internet host specified by ip_address.

2.
string gethostbyname ( string $hostname )

Returns the IP address of the Internet host specified by hostname.

3.
array gethostbynamel ( string $hostname )

Returns a list of IP addresses to which the Internet host specified by hostname resolves.

4.
bool getmxrr ( string $hostname , array &$mxhosts [, array &$weight ] )

Searches DNS for MX records corresponding to hostname. Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred.

5.
int checkdnsrr ( string $host [, string $type ] )

Searches DNS for records of type type corresponding to host. Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred.

6.
array dns_get_record ( string $hostname [, int $type [, array &$authns ]], array &$addtl )

Fetch DNS Resource Records associated with the given hostname.

7.
int getprotobyname ( string $name )

Returns the protocol number associated with the protocol name as per /etc/protocols.

8.
string getprotobynumber ( int $number )

Returns the protocol name associated with protocol number as per /etc/protocols.

9.
int getservbyname ( string $service , string $protocol )

Returns the Internet port which corresponds to service for the specified protocol as per /etc/services.

10.
string inet_ntop ( string $in_addr )

This function converts a 32bit IPv4, or 128bit IPv6 address (if PHP was built with IPv6 support enabled) into an address family appropriate string representation.

11.
string inet_pton ( string $address )

This function converts a human readable IPv4 or IPv6 address (if PHP was built with IPv6 support enabled) into an address family appropriate 32bit or 128bit binary structure.

12.
bool syslog ( int $priority , string $message )

Generates a log message that will be distributed by the system logger.

Post a Comment