PHP vprintf Function

What is vprintf Function?

Explanation

This function is used to output a formatted string.

Syntax:


vprintf(format,argarray)

In the above syntax "format" specifes the formatting string to be used "%%", "%b", "%c", "%d", "%e", "%u", "%f", "%F", "%o", "%s", "%x", "%X", "argarray" specifies an array with arguments to be inserted at % sign.

Example :


<?php
$str = "Hi";
$number = 200;
vprintf("%s my mark is %u",array($str,$number));
?>
Result :

Hi my mark is 200

In the above PHP example the output is displayed using the vprintf() function.

PHP Topics


Ask Questions

Ask Question