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.

each<br />

array each(array array)<br />

Creates an array containing the keys and values of the element currently pointed at by the<br />

array’s internal pointer. The array contains four elements: elements with the keys 0 and key<br />

from the element contain the key of the element, and elements with the keys 1 and value<br />

contain the value of the element.<br />

If the internal pointer of the array points beyond the end of the array, each( ) returns false.<br />

echo<br />

void echo string string[, string string2[, string stringN ...]]<br />

Outputs the given strings. echo is a language construct, and enclosing the parameters in<br />

parentheses is optional, unless multiple parameters are given—in this case, you cannot use<br />

parentheses.<br />

empty<br />

bool empty(mixed value)<br />

Returns true if value is either 0 or not set, and false otherwise.<br />

end<br />

mixed end(array array)<br />

Advances the array’s internal pointer to the last element and returns the element’s value.<br />

ereg<br />

int ereg(string pattern,string string[, array matches])<br />

Searches string for the regular expression pattern. If given, the array matches is filled with<br />

the subpattern matches. Returns true if the pattern matched in string and false if not. See<br />

Chapter 4 for more information on using regular expressions.<br />

ereg_replace<br />

string ereg_replace(string pattern,string replace, string string)<br />

Searches for all occurrences of the regular expression pattern in string, replaces them with<br />

replace, and returns the result.<br />

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