05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

addcslashes<br />

string addcslashes(string string, string characters)<br />

Escapes instances of characters in string by adding a backslash before them. You can<br />

specify ranges of characters by separating them by two periods; for example, to escape<br />

characters between a and q, use "a..q". Multiple characters and ranges can be specified in<br />

characters. The addcslashes( ) function is the inverse of stripcslashes( ).<br />

addslashes<br />

string addslashes(string string)<br />

Escapes characters in string that have special meaning in SQL database queries. Single<br />

quotes (''), double quotes (""), backslashes (\), and the NUL-byte ("\0") are escaped. The<br />

stripslashes( ) function is the inverse for this function.<br />

array<br />

array array([mixed ...])<br />

Creates an array using the parameters as elements in the array. By using the => operator,<br />

you can specify specific indexes for any elements; if no indexes are given, the elements are<br />

assigned indexes starting from 0 and incrementing by one. The internal pointer (see<br />

current, reset, and next) is set to the first element.<br />

$array = array("first", 3 => "second", "third", "fourth" => 4);<br />

Note: array is actually a language construct, used to denote literal arrays, but its usage is<br />

similar to that of a function, so it’s included here.<br />

array_count_values<br />

array array_count_values(array array)<br />

Returns an array whose elements’ keys are the input array’s values. The value of each key is<br />

the number of times that key appears in the input array as a value.<br />

array_diff<br />

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

Returns an array containing all of the values from the first array that are not present in any<br />

of the other arrays. The keys of the values are preserved.<br />

array_filter<br />

array array_filter(array array, mixed callback)<br />

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