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.

setlocale<br />

string setlocale(mixed category, string locale)<br />

Sets the locale for category functions to locale. Returns the current locale after being set,<br />

or false if the locale cannot be set. Any number of options for category can be added (or<br />

ORed) together. The following options are available:<br />

LC_ALL (default) All of the following categories<br />

LC_COLLATE String comparisons<br />

LC_CTYPE Character classification and conversion<br />

LC_MONETARY Monetary functions<br />

LC_NUMERIC Numeric functions<br />

LC_TIME Time and date formatting<br />

If locale is 0 or the empty string, the current locale is unaffected.<br />

settype<br />

bool settype(mixed value, string type)<br />

Converts value to the given type. Possible types are "boolean", "integer", "double",<br />

"string", "array", and "object". Returns true if the operation was successful and false if<br />

not. Using this function is the same as typecasting value to the appropriate type.<br />

shell_exec<br />

string shell_exec(string command)<br />

Executes command via the shell and returns the last line of output from the command’s<br />

result. This function is called when you use the backtick operator (``).<br />

shuffle<br />

void shuffle(array array)<br />

Rearranges the values in array into a random order. Keys for the values are lost. Before you<br />

call shuffle( ), be sure to seed the random-number generator using srand( ).<br />

similar_text<br />

int similar_text(string one, string two[, double percent])<br />

Calculates the similarity between the strings one and two. If passed by reference, percent<br />

gets the percent by which the two strings differ.<br />

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