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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With