Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

curren iuml para yacute
deg iuml plusmn yen


divide laquo pound yuml


string long2ip(integer address)


Use long2ip to get the textual representation of an IP address. Use ip2long to
reverse the process.


string ltrim(string text)


The ltrim function returns the text argument with any leading whitespace removed. If
you wish to remove whitespace on the end of the string, use chop. If you wish to remove
whitespace from the beginng and end, use trim. Whitespace includes spaces, tabs and
other nonprintable characters, including nulls (ASCII 0).


<?


$text = " Leading whitespace";
print("

". ltrim($text). "
");
?>


string nl2br(string text)


The nl2br function inserts
before every newline in the text argument and returns
the modified text.


<?


$text = "line1\nline2\nline3\n";
print(nl2br($text));
?>


string number_format(double value, integer precision, string
decimal, string thousands)


The number_format function returns a formatted representation of the value
argument as an integer with commas inserted to separate thousands. The optional
precision argument specifies the number of digits after the decimal point, which by
default is zero. The optional decimal and thousands arguments must be used
together. They override the default use of periods and commas for decimal points and
thousands separators.

Free download pdf