![]() |
VOOZH | about |
The vprintf() function in PHP is an inbuilt function which is used to display array values as a formatted string
Display array values as a formatted string according to format it is work similar as printf() but accepts an array of arguments, in place of variables number of arguments. Returns the length of the outputted string on success.
Syntax:
vprintf (format, array_arguments)
Parameters:
Program 1: This program will be showing uses of % b d u x X f F o formats using vprintf function.
using %% format: % % % % using %b format: 1001 1010 1111 1111111111111111111111111111111111111111111111111111111111111111 using %d format: 9 10 15 -1 using %u format: 9 10 15 18446744073709551615 using %x format: 9 a f ffffffffffffffff using %X format: 9 A F FFFFFFFFFFFFFFFF using %f format: 9.000000 10.000000 15.000000 -1.000000 using %F format: 9.000000 10.000000 15.000000 -1.000000 using %o format: 11 12 17 1777777777777777777777
Program 2: This program will be showing uses of c and s formats using vprintf function.
using %c format: A B a b using %s format: 65 66 97 98
Program 3: This program will be showing uses of e g E G formats using vprintf function.
using %e format: 1.000000e+9 1.459566e+8 1.111111e+8 1.000000e+8 using %g format: 1.0e+9 1.45957e+8 1.11111e+8 1.0e+8 using %E format: 1.000000E+9 1.459566E+8 1.111111E+8 1.000000E+8 using %G format: 1.0E+9 1.45957E+8 1.11111E+8 1.0E+8
Program 4: In this program, all four variable will be print respectively 10 20 30 40 space separated using vprintf function.
gfg 1 gfg 2 gfg 3 gfg 4