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.

sort<br />

void sort(array array[, int flags])<br />

Sorts the values in the given array in ascending order. For more control over the behavior<br />

of the sort, provide the second parameter, which is one of the following values:<br />

See Chapter 5 for more information on using this function.<br />

soundex<br />

string soundex(string string)<br />

Calculates and returns the soundex key of string. Words that are pronounced similarly<br />

(and begin with the same letter) have the same soundex key.<br />

split<br />

array split(string pattern, string string[, int limit])<br />

Returns an array of strings formed by splitting string on boundaries formed by the regular<br />

expression pattern. Iflimit is specified, at most that many substrings will be returned; the<br />

last substring will contain the remainder of string.<br />

If your split is such that you don’t need regular expressions, explode( ) performs a similar<br />

function and is much faster.<br />

spliti<br />

array spliti(string pattern, string string[, int limit])<br />

Returns an array of strings formed by splitting string on boundaries formed by the regular<br />

expression pattern. Pattern matching is performed in a case-insensitive manner. If limit is<br />

specified, at most that many substrings will be returned; the last substring will contain the<br />

remainder of string. This function is a case-insensitive version of split( ).<br />

sprintf<br />

SORT_REGULAR (default) Compare the items normally.<br />

SORT_NUMERIC Compare the items numerically.<br />

SORT_STRING Compare the items as strings.<br />

string sprintf(string format[, mixed value1[, ... mixed valueN]])<br />

Returns a string created by filling format with the given arguments. See printf for more<br />

information on using this function.<br />

442 | 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!