Changes

PHP Arrays

317 bytes added, 19:34, 1 June 2007
Getting Information About PHP Arrays
Associative arrays can be sorted in two ways, either by key or by value. To sort by key use ''ksort'' and ''krsort'' (reverse sort). To sort by value use the ''asort'' and ''arsort'' functions. The syntax and options for these functions are as outlined for the ''sort'' and ''rsort'' functions above.
== Getting Information About PHP Arrays & other Array Functions ==
There are number of useful functions which can be used to obtain information about PHP arraysand also some function that have noit been covered in detail in this chapter. The following table lists these functions and provides descriptions:
<table border="1" cellspacing="0" width="100%">
<tr>
<td>in_array<td>Returns true ot false depneding on whether specified value is in array</td>
<tr>
<td>array_merge<td>Merge two or more arrays into a single array</td>
<tr>
<td>array_reverse<td>Reverse the roder of elemenst in an array</td>
</table>