vsprintf

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

© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/function.vsprintf.php

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部