How to Use vsprintf in PHP

In this article I will explain how vsprintf Function can be used in PHP.
  • 1604
vsprintf() Function

This function writes a formatted string to a variable.

Syntax

vsprintf(format,argarray)

Example

<html>
<body>
<?php
$str = "Hi";
$number = 123;
$txt = vsprintf("%s Swati. Day number %u",array($str,$number));
echo $txt;
?>
</body>
</html>

 

Output

vsprintf-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.