home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Programming PHPProgramming PHPSearch this book

A.2c. Alphabetical Listing of PHP Functions (j-q)

localeconv

array localeconv( )

Returns an associative array of information about the current locale's numeric and monetary formatting. The array contains the following elements:

 

decimal_point

 

Decimal-point character

 

thousands_sep

 

Separator character for thousands

 

grouping

 

Array of numeric groupings; indicates where the number should be separated using the thousands separator character

 

int_curr_symbol

 

International currency symbol (e.g., "USD")

 

currency_symbol

 

Local currency symbol (e.g., "$")

 

mon_decimal_point

 

Decimal-point character for monetary values

 

mon_thousands_sep

 

Separator character for thousands in monetary values

 

positive_sign

 

Sign for positive values

 

negative_sign

 

Sign for negative values

 

int_frac_digits

 

International fractional digits

 

frac_digits

 

Local fractional digits

 

p_cs_precedes

 

true if the local currency symbol precedes a positive value; false if it follows the value

 

p_sep_by_space

 

true if a space separates the local currency symbol from a positive value

 

p_sign_posn

 

0 if parentheses surround the value and currency symbol for positive values, 1 if the sign precedes the currency symbol and value, 2 if the sign follows the currency symbol and value, 3 if the sign precedes the currency symbol, and 4 if the sign follows the currency symbol

 

n_cs_precedes

 

true if the local currency symbol precedes a negative value; false if it follows the value

 

n_sep_by_space

 

true if a space separates the local currency symbol from a negative value

 

n_sign_posn

 

0 if parentheses surround the value and currency symbol for negative values, 1 if the sign precedes the currency symbol and value, 2 if the sign follows the currency symbol and value, 3 if the sign precedes the currency symbol, and 4 if the sign follows the currency symbol

pack

string pack(string format, mixed arg1[, mixed arg2[, ... mixed argN]])

Creates a binary string containing packed versions of the given arguments according to format. Each character may be followed by a number of arguments to use in that format, or an asterisk (*), which uses all arguments to the end of the input data. If no repeater argument is specified, a single argument is used for the format character. The following characters are meaningful in the format string:

 

a

 

NUL-byte-padded string

 

A

 

Space-padded string

 

h

 

Hexadecimal string, with the low nibble first

 

H

 

Hexadecimal string, with the high nibble first

 

c

 

Signed char

 

C

 

Unsigned char

 

s

 

16-bit, machine-dependent byte-ordered signed short

 

S

 

16-bit, machine-dependent byte-ordered unsigned short

 

n

 

16-bit, big-endian byte-ordered unsigned short

 

v

 

16-bit, little-endian byte-ordered unsigned short

 

i

 

Machine-dependent size and byte-ordered signed integer

 

I

 

Machine-dependent size and byte-ordered unsigned integer

 

l

 

32-bit, machine-dependent byte-ordered signed long

 

L

 

32-bit, machine-dependent byte-ordered unsigned long

 

N

 

32-bit, big-endian byte-ordered unsigned long

 

V

 

32-bit, little-endian byte-ordered unsigned long

 

f

 

Float in machine-dependent size and representation

 

d

 

Double in machine-dependent size and representation

 

x

 

NUL-byte

 

X

 

Back up one byte

 

@

 

Fill to absolute position (given by the repeater argument) with NUL-bytes

printf

int printf(string format[, mixed arg1 ...])

Outputs a string created by using format and the given arguments. The arguments are placed into the string in various places denoted by special markers in the format string.

Each marker starts with a percent sign (%) and consists of the following elements, in order. Except for the type specifier, the specifiers are all optional. To include a percent sign in the string, use %%.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.