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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
vsprintf()is your friend. You cannot use an array insprintfin any meaningfull way, but you can callvsprintf()with an array of arguments (which replacessprintf‘s seperate function arguments).