vprintf
vprintf
(PHP 4 >= 4.1.0, PHP 5, PHP 7)
vprintf — Output a formatted string
Description
int vprintf ( string $format , array $args )
Display array values as a formatted string according to format
(which is described in the documentation for sprintf()).
Operates as printf() but accepts an array of arguments, rather than a variable number of arguments.
Parameters
-
format
-
See sprintf() for a description of
format
. -
args
Return Values
Returns the length of the outputted string.
Examples
Example #1 vprintf(): zero-padded integers
<?php vprintf("%04d-%02d-%02d", explode('-', '1988-8-1')); // 1988-08-01 ?>
See Also
- printf() - Output a formatted string
- sprintf() - Return a formatted string
- vsprintf() - Return a formatted string
© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/function.vprintf.php