views:

18

answers:

1

From the PHP API reference:

string sprintf ( string $format [, mixed $args [, mixed $... ]] )

Returns a string produced according to the formatting string format.

Can $args be an array - If so how would I use it?

+3  A: 

vsprintf() is your friend. You cannot use an array in sprintf in any meaningfull way, but you can call vsprintf() with an array of arguments (which replaces sprintf 's seperate function arguments).

Wrikken