Loader

vprintf

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. Test vprintf online.

Enter a array in the following way: [value1, value2, value3]

PHP Documentation by the PHP Documentation Group


vprintf

(PHP 4 >= 4.1.0, PHP 5, PHP 7)

vprintfOutput 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


PHP Documentation

Copyright © 1997 - 2016 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution 3.0 License or later. A copy of the Creative Commons Attribution 3.0 license is distributed with this manual. The latest version is presently available at » http://creativecommons.org/licenses/by/3.0/.