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?
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?
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).