downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

wordwrap> <vprintf
[edit] Last updated: Fri, 24 May 2013

view this page in

vsprintf

(PHP 4 >= 4.1.0, PHP 5)

vsprintfRetourne une chaîne formatée

Description

string vsprintf ( string $format , array $args )

vsprintf() fonctionne comme sprintf(), mais accepte un tableau comme argument, au lieu d'une liste d'arguments.

Liste de paramètres

format

Voir la documentation de la fonction sprintf() pour une description détaillée du paramètre format.

args

Valeurs de retour

Retourne une chaîne formatée à partir du tableau de valeurs args, et en utilisant le format format. Le format est le même que celui utilisé par sprintf().

Exemples

Exemple #1 Exemple avec vsprintf() : entiers avec zéro initiaux

<?php
print vsprintf("%04d-%02d-%02d"explode('-''1988-8-1')); // 1988-08-01
?>

Voir aussi



wordwrap> <vprintf
[edit] Last updated: Fri, 24 May 2013
 
add a note add a note User Contributed Notes vsprintf - [16 notes]