• PHP Video Tutorials

PHP - Function Vsprintf



Syntax

string vsprintf ( string $format , array $args )

Definition and Usage

It returns the formatted string

Return Values

It returns array value as formatted string

Parameters

Sr.No Parameters & Description
1

format

It is used to specifies string and how to format the variable in it

2

argarray

It is used to specifies an array with argument to be inserted

Example

Try out the following example

<?php
   print vsprintf("%04d-%02d-%02d", explode('-', '1990-12-25'));
?>

This will produce following result −

1990-12-25
php_function_reference.htm
Advertisements