<<

. 101
( 132 .)



>>

int Gets the number of fields
mysql_num_fields(int result)
in a result
array Gets a result row as an
mysql_fetch_row(int result)
enumerated array
object Fetches a result row as an
mysql_fetch_object(int result
object
[, int result_type])

array Fetches a result row as an
mysql_fetch_array(int result
array (associative, numeric,
[, int result_type])
or both)
array Fetches a result row as an
mysql_fetch_assoc(int result)
associative array
bool Moves the internal result
mysql_data_seek(int result,
pointer
int row_number)

array Gets the maximum data
mysql_fetch_lengths(int result)
size of each column in a
result
object Gets the column
mysql_fetch_field(int result
information from a result
[, int field_offset])
and returns it as an object
Continued
610 Part V: Appendixes


TABLE F-1 MYSQL FUNCTIONS (Continued)

Function Return Value Action

bool Sets the result pointer to a
mysql_field_seek(int result,
specific field offset
int field_offset)

string Gets the name of the
mysql_field_name(int result,
specified field in a result
int field_index)

string Gets the name of the table
mysql_field_table(int result,
the specified field is in
int field_offset)

int Returns the length of the
mysql_field_len(int result,
specified field
int field_offset)

string Gets the type of the
mysql_field_type(int result,
specified field in a result
int field_offset)

string Gets the flags associated
mysql_field_flags(int result,
with the specified field in a
int field_offset)
result
bool Frees memory associated
mysql_free_result(int result)
with the result




TABLE F-2 STRING-MANIPULATION FUNCTIONS

Function Return Value Action

string Converts the binary repre-
bin2hex(string data)
sentation of data to hex
int Finds the length of the
strspn(string str, string mask)
initial segment consisting
entirely of characters
found in mask
int Finds the length of the
strcspn(string str, string mask)
initial segment consisting
entirely of characters not
found in mask
string Queries the language and
nl_langinfo(int item)
locale information
Appendix F: PHP Function Reference 611



Function Return Value Action

int Compares two strings
strcoll(string str1, string str2)
using the current locale
string An alias for rtrim
chop(string str
[, string character_mask])

string Removes trailing white
rtrim(string str
space
[, string character_mask])

string Strips white space from
trim(string str
the beginning and end of
[, string character_mask])
a string
string Strips white space from
ltrim(string str
the beginning of a string
[, string character_mask])

string Wraps a string to a given
wordwrap(string str [, int width
number of characters using
[, string break [, int cut]]])
a string break character.
array Splits a string-on-the
explode(string separator,
string separator and
string str [, int limit])
returns an array of
components
string An alias for implode
join(array src, string glue)

string Joins array elements by
implode(array src, string glue)
placing the glue string
between items and returns
one string
string Tokenizes a string
strtok([string str,]
string token)

string Makes a string upper case
strtoupper(string str)

string Makes a string lower case
strtolower(string str)

string Returns the file-name
basename(string path
component of the path
[, string suffix])

string Returns the directory-
dirname(string path)
name component of the
path
Continued
612 Part V: Appendixes


TABLE F-2 STRING-MANIPULATION FUNCTIONS (Continued)

Function Return Value Action

array Returns information about
pathinfo(string path)
a certain string
string Finds the first occurrence
stristr(string haystack,
of a string within another
string needle)
(case-insensitive)
string Finds the first occurrence
strstr(string haystack,
of a string within another
string needle)

string An alias for strstr
strchr(string haystack,
string needle)

int Finds the position of the
strpos(string haystack,
first occurrence of a string
string needle [, int offset])
within another
int Finds the position of the
strrpos(string haystack,
last occurrence of a
string needle)
character in a string within
another
string Finds the last occurrence
strrchr(string haystack,
of a character in a string
string needle)
within another
string Returns a split line
chunk_split(string str [, int
chunklen [, string ending]])

string Returns part of a string
substr(string str, int start
[, int length])

string Replaces part of a string
substr_replace(string str,
with another string
string repl, int start
[, int length])

string Quotes meta-characters
quotemeta(string str)

int Returns the ASCII value of
ord(string character)
a character
string Converts ASCII code to a
chr(int ascii)
character
string Makes a string™s first
ucfirst(string str)
character upper case
Appendix F: PHP Function Reference 613



Function Return Value Action

string Renders the first character
ucwords(string str)
of every word in a string in
upper case
string Translates characters in
strtr(string str, string from,
str using given
string to)
translation tables
string Reverses a string
strrev(string str)

int Calculates the similarity
similar_text(string str1,
between two strings
string str2 [, float percent])

string Escapes all characters
addcslashes(string str,
mentioned in charlist
string charlist)
with backslashes. Creates
octal representations if
asked to backslash
characters with eighth-bit
set or with ASCII<32
(except \n, \r, \t, and
so on)
string Escapes single quotes,
addslashes(string str)
double quotes, and
backslash characters in a
string with backslashes

<<

. 101
( 132 .)



>>