..])
variables stored by the session
Continued
3537-4 AppE.f.qc 12/15/00 15:26 Page 500
500
Part V: Appendixes
TABLE E-37 SESSION FUNCTIONS (Continued)
Function
Returns
Action
session_unregister
bool
Removes varname from the list of
(string varname)
variables stored by the session
session_is_registered
bool
Checks if a variable is registered in
(string varname)
session
session_encode(void)
string
Serializes the current setup and
returns the serialized representation
session_decode(string data)
bool
Deserializes data and reinitializes the
variables
session_start(void)
bool
Begins session — reinitializes freezed
variables, registers browsers, and so
forth
session_destroy(void)
bool
Destroys the current session and all
data associated with it
session_unset(void)
void
Unsets all registered variables
Session functions are described in more detail in Chapter 14.
XREF
TABLE E-38 DNS FUNCTIONS
Function
Returns
Action
gethostbyaddr(string
string
Gets the Internet host name
ip_address)
corresponding to a given IP address
gethostbyname(string
string
Gets the IP address corresponding to
hostname)
a given Internet host name
gethostbynamel(string
array
Returns a list of IP addresses that a
hostname)
given host name resolves to
3537-4 AppE.f.qc 12/15/00 15:26 Page 501
Appendix E: PHP Function Reference
501
Function
Returns
Action
checkdnsrr(string host
int
Checks DNS records corresponding to
[, string type])
a given Internet host name or IP
address
getmxrr(string hostname,
int
Gets MX records corresponding to a
array mxhosts [, array
given Internet host name
weight])
TABLE E-39 MATH FUNCTIONS
Function
Returns
Action
abs(int number)
int
Returns the absolute value of the
number
ceil(double number)
int
Returns the next highest integer
value of the number
floor(double number)
int
Returns the next lowest integer value
of the number
round(double number
double
Returns the number rounded to
[, int precision])
specified precision
sin(double number)
double
Returns the sine of the number in
radians
cos(double number)
double
Returns the cosine of the number in
radians
tan(double number)
double
Returns the tangent of the number in
radians
asin(double number)
double
Returns the arc sine of the number in
radians
acos(double number)
double
Return the arc cosine of the number
in radians
atan(double number)
double
Returns the arc tangent of the
number in radians
Continued
3537-4 AppE.f.qc 12/15/00 15:26 Page 502
502
Part V: Appendixes
TABLE E-39 MATH FUNCTIONS (Continued)
Function
Returns
Action
atan2(double y, double x)
double
Returns the arc tangent of y/x, with
the resulting quadrant determined by
the signs of y and x
pi(void)
double
Returns an approximation of pi
pow(double base, double
double
Returns base raised to the power of
exponent)
exponent
exp(double number)
double
Returns e raised to the power of the
number
log(double number)
double
Returns the natural logarithm of the
number
log10(double number)
double
Returns the base-10 logarithm of the
number
sqrt(double number)
double
Returns the square root of the number
deg2rad(double number)
double
Converts the number in degrees to
the radian equivalent
rad2deg(double number)
double
Converts the radian number to the
equivalent number in degrees
bindec(string binary_number)
int
Returns the decimal equivalent of
the binary number
hexdec(string
int
Returns the decimal equivalent of
hexadecimal_number)
the hexadecimal number
octdec(string octal_number)
int
Returns the decimal equivalent of an
octal string
decbin(int decimal_number)
string
Returns a string containing a binary
representation of the number
decoct(int decimal_number)
string
Returns a string containing an octal
representation of the given number
dechex(int decimal_number)
string
Returns a string containing a
hexadecimal representation of the
given number
3537-4 AppE.f.qc 12/15/00 15:26 Page 503
Appendix E: PHP Function Reference
503
Function
Returns
Action
base_convert(string number,
string
Converts a number in a string from
int frombase, int tobase)
any base <= 36 to any base <= 36.
number_format(double
string
Formats a number with grouped
number [, int num_decimal_
thousands
places [, string dec_
seperator, string
thousands_seperator]])
TABLE E-40 MD5
Function
Returns
Action
md5(string str)
string
Calculates the md5 hash of a string
TABLE E-41 OUTPUT BUFFERING
Function
Returns
Action
ob_start(void)
void
Turns on output buffering
ob_end_flush(void)
void
Flushes (sends) the output buffer and
turns off output buffering
ob_end_clean(void)
void