<<

. 105
( 132 .)



>>

int Returns true if the file is
is_dir(string filename)
a directory
int Returns true if the file is
is_link(string filename)
a symbolic link
bool Returns true if the file
file_exists(string filename)
name exists
array Gives information about a
lstat(string filename)
file or symbolic link
array Gives information about
stat(string filename)
a file
Appendix F: PHP Function Reference 627


TABLE F-10 FSOCK FUNCTIONS

Function Return Value Action

int Opens an Internet or Unix
fsockopen(string hostname, int
domain-socket connection
port [, int errno [, string
errstr [, float timeout]]])

int Opens a persistent Internet
pfsockopen(string hostname, int
or Unix domain-socket
port [, int errno [, string errstr
connection
[, float timeout]]])




TABLE F-11 HTTP HEADER FUNCTIONS

Function Return Value Action

void Sends a raw HTTP header
header(string header
[, bool replace])

bool Sends a cookie
setcookie(string name
[, string value [, int expires
[, string path [, string domain
[, bool secure]]]]])

int Returns true if headers
headers_sent(void)
have already been sent,
false otherwise




TABLE F-12 HTML-RELATED FUNCTIONS

Function Return Value Action

string Converts special characters
htmlspecialchars(string string
into HTML entities
[, int quote_style][, string
charset])

string Converts all applicable
htmlentities(string string
characters into HTML
[, int quote_style][, string
entities
charset])

Continued
628 Part V: Appendixes


TABLE F-12 HTML-RELATED FUNCTIONS (Continued)

Function Return Value Action

array Returns the internal
get_html_translation_table([int
translation table used by
table [, int quote_style]])
htmlspecialchars and
htmlentities




TABLE F-13 PHP-INFORMATION FUNCTIONS

Function Return Value Action

void Outputs a page of useful
phpinfo([int what])
information about PHP and
the current request
string Returns the current PHP
phpversion([string extension])
version
void Prints the list of people
phpcredits([int flag])
who™ve contributed to the
PHP project
string Returns the current SAPI
php_sapi_name(void)
module name
string Returns information about
php_uname(void)
the system PHP was built on




TABLE F-14 MATH FUNCTIONS

Function Return Value Action

int Returns the absolute value
abs(int number)
of the number
float Returns the next highest
ceil(float number)
integer value from the
number
Appendix F: PHP Function Reference 629



Function Return Value Action

float Returns the next lowest
floor(float number)
integer value from the
number
float Returns the number rounded
round(float number
to the specified precision
[, int precision])

float Returns the sine of the
sin(float number)
number in radians
float Returns the cosine of the
cos(float number)
number in radians
float Returns the tangent of the
tan(float number)
number in radians
float Returns the arc sine of the
asin(float number)
number in radians
float Return the arc cosine of the
acos(float number)
number in radians
float Returns the arc tangent of
atan(float number)
the number in radians
float Returns the arc tangent
atan2(float y, float x)
of y/x, with the resulting
quadrant determined by the
sines of y and x
float Returns the hyperbolic
sinh(float number)
sine of the number, defined
as (exp(number) “
exp(“number))/2
float Returns the hyperbolic
cosh(float number)
cosine of the number,
defined as (exp(number) +
exp(“number))/2
float Returns the hyperbolic
tanh(float number)
tangent of the number,
defined as sinh(number)/
cosh(number)
Continued
630 Part V: Appendixes


TABLE F-14 MATH FUNCTIONS (Continued)

Function Return Value Action

float Returns the inverse
asinh(float number)
hyperbolic sine of the
number, that is, the value
whose hyperbolic sine is
number

float Returns the inverse
acosh(float number)
hyperbolic cosine of the
number, that is, the value
whose hyperbolic cosine is
number

float Returns the inverse
atanh(float number)
hyperbolic tangent of the
number, that is, the value
whose hyperbolic tangent is
number

float Returns an approximation
pi(void)
of pi
bool Returns whether argument
is_finite(float val)
is finite
bool Returns whether argument
is_infinite(float val)
is infinite
bool Returns whether argument
is_nan(float val)
is not a number
number Returns base raised to the
pow(number base, number
power of exponent; returns
exponent)
the integer result when
possible
float Returns e raised to the
exp(float number)
power of number
float Returns exp(number) “ 1,
expm1(float number)
computed in a way that is
accurate even when the
value of number is close
to 0
Appendix F: PHP Function Reference 631



Function Return Value Action

float Returns log(1 + number),
log1p(float number)
computed in a way that is
accurate even when the
value of number is close to 0
float Returns the natural
log(float number)
logarithm of the number
float Returns the base-10
log10(float number)
logarithm of the number
float Returns the square root of
sqrt(float number)
the number
float Converts the number in
deg2rad(float number)
degrees to the radian
equivalent
float Converts the radian number
rad2deg(float number)
to the equivalent number in
degrees
int Returns the decimal
bindec(string binary_number)

<<

. 105
( 132 .)



>>