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.

number_format<br />

string number_format(double number[, int precision[, string decimal_separator,<br />

string thousands_separator]])<br />

Creates a string representation of number. Ifprecision is given, the number is rounded to<br />

that many decimal places; the default is no decimal places, creating an integer. If decimal_<br />

separator and thousands_separator are provided, they are used as the decimal-place character<br />

and thousands separator, respectively. They default to the English locale versions (“.”<br />

and “,”). For example:<br />

$number = 7123.456;<br />

$english = number_format($number, 2); // 7,123.45<br />

$francais = number_format($number, 2, ',', ' '); // 7 123,45<br />

$deutsche = number_format($number, 2, ',', '.'); // 7.123,45<br />

If rounding occurs, proper rounding is performed, which may not be what you expect (see<br />

round).<br />

ob_end_clean<br />

void ob_end_clean( )<br />

Turns off output buffering and empties the current buffer without sending it to the client.<br />

See Chapter 13 for more information on using the output buffer.<br />

ob_end_flush<br />

void ob_end_flush( )<br />

Sends the current output buffer to the client and stops output buffering. See Chapter 13 for<br />

more information on using the output buffer.<br />

ob_get_contents<br />

string ob_get_contents( )<br />

Returns the current contents of the output buffer; if buffering has not been enabled with a<br />

previous call to ob_start( ), returns false. See Chapter 13 for more information on using<br />

the output buffer.<br />

ob_get_length<br />

int ob_get_length( )<br />

Returns the length of the current output buffer, or false if output buffering isn’t enabled.<br />

See Chapter 13 for more information on using the output buffer.<br />

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