Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

The way array_multisort works is similar to the way a relational database sorts the
results of a join. The first element of each array is joined into a virtual row, and all
elements in a row move together. The arrays are sorted by the first array. In the case
where elements of the first array repeat, rows are sorted on the second row. Sorting
continues as necessary.


Figure 9-3. array_multisort.

array array_pad(array data, integer size, value padding)


The array_pad function adds elements to an array until it has the number of elements
specified by the size argument. If the array is long enough already, no elements are
added. Otherwise, the padding argument is used for the value of the new elements. If the
size argument is positive, padding is added to the end of the array. If the size argument
is negative, padding is added to the beginning.


<?

Free download pdf