Loader

vsprintf

Operates as sprintf() but accepts an array of arguments, rather than a variable number of arguments. Test vsprintf online.

string vsprintf ( string $format , array $args )

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

PHP Documentation by the PHP Documentation Group


vsprintf

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

vsprintfReturn a formatted string

Description

string vsprintf ( string $format , array $args )

Operates as sprintf() 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

Return array values as a formatted string according to format (which is described in the documentation for sprintf()).

Examples

Example #1 vsprintf(): zero-padded integers

<?php
print vsprintf("%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/.