|
Appendix B
Useful PHP Built-in Functions
P
HP is as powerful as it is because of its many functions. This Appendix
is a reference to the most useful functions.
Some of the functions are discussed at various places in the book; some are
not. If the function is discussed in the book, its definition includes a chapter
reference where a more complete description can be found.
Array Functions
This section describes built-in functions that work with arrays.
array
Creates a new array. (See Chapter 6.)
Format:
$array = array(key=>value,key=>value,key=>value,...);
array_count_values
Creates an array that contains a count of the values in the original array.
Format:
$array_out = array_count_values($orig_array);
For example, suppose that
$orig_array
contained the following:
$orig_array[a] = John
$orig_array[b] = Mary
$orig_array[c] = John
$orig-Array[d] = Jose
Then
$array_out
would contain the following:
$array[John] = 2
$array[Mary} = 1
$array[Jose] = 1
|