Miscellaneous Functions

DNS/Networking Functions

int checkdnsrr(string host [, string type])

Check DNS records corresponding to a given Internet hostname or IP address

int fsockopen(string hostname, int port [, int errno [, string errstr]])

Open Internet or Unix domain socket connection

string gethostbyaddr(string ip_address)

Get the Internet hostname corresponding to a given IP address

string gethostbyname(string hostname)

Get the IP address corresponding to a given Internet hostname

array gethostbynamel(string hostname)

Return a list of IP addresses that a given hostname resolves to

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

Get MX records corresponding to a given Internet hostname

set_socket_blocking(int socket descriptor, int mode)

Set blocking/non-blocking mode on a socket

Program Execution Functions

escapeshellcmd(string command)

Escape shell metacharacters

int exec(string command [, array output [, int return_value]])

Execute an external program

int passthru(string command [, int return_value])

Execute an external program and display raw output

int system(string command [, int return_value])

Execute an external program and display output

Random Number Functions

int getrandmax(void)

Return the maximum value a random number can have

int mt_getrandmax(void)

Return the maximum value a random number from Mersenne Twister can have

int mt_rand([int min, int max])

Return a random number from Mersenne Twister

void mt_srand(int seed)

Seed Mersenne Twister random number ...

Get Webmaster in a Nutshell, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.