05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

array_merge<br />

array array_merge(array array1, array array2[, ... array arrayN])<br />

Returns an array created by appending the elements of every array to the previous. If any<br />

array has a value with the same string key, the last value encountered for the key is<br />

returned in the array; any elements with identical numeric keys are inserted into the<br />

resulting array.<br />

array_merge_recursive<br />

array array_merge_recursive(array array1, array array2[, ... array arrayN])<br />

Like array_merge( ), creates and returns an array by appending each input array to the<br />

previous. Unlike that function, when multiple elements have the same string key, an array<br />

containing each value is inserted into the resulting array.<br />

array_multisort<br />

bool array_multisort(array array1[, SORT_ASC|SORT_DESC<br />

[, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]]<br />

[, array array2[, SORT_ASC|SORT_DESC<br />

[, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...])<br />

Used to sort several arrays simultaneously, or to sort a multidimensional array in one or<br />

more dimensions. The input arrays are treated as columns in a table to be sorted by rows—<br />

the first array is the primary sort. Any values that compare the same according to that sort<br />

are sorted by the next input array, and so on.<br />

The first argument is an array; following that, each argument may be an array or one of the<br />

following order flags (the order flags are used to change the default order of the sort):<br />

SORT_ASC (default) Sort in ascending order<br />

SORT_DESC Sort in descending order<br />

After that, a sorting type from the following list can be specified:<br />

SORT_REGULAR (default) Compare items normally<br />

SORT_NUMERIC Compare items numerically<br />

SORT_STRING Compare items as strings<br />

The sorting flags apply only to the immediately preceding array, and they revert to SORT_ASC<br />

and SORT_REGULAR before each new array argument.<br />

This function returns true if the operation was successful and false if not.<br />

array_pad<br />

array array_pad(array input, int size[, mixed padding])<br />

380 | Appendix A: Function Reference<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!