0 votes
in PHP by

What is the use of sprintf() function in PHP?

a) The sprintf() function is used to print the output of program

b) The sprintf() function is used to send output to variable

c) Both of the above

d) None of the above

1 Answer

0 votes
by
b) The sprintf() function is used to send output to variable

Description: The sprintf() is an in-built function of PHP which writes a formatted string to a variable. It returns a formatted string. The sprintf() function is similar to the printf() function, but the only difference between both of them is that sprint() saves the output into a string instead of displaying the formatted message on browser like printf() function.

Related questions

+1 vote
asked May 11, 2022 in PHP by sharadyadav1986
0 votes
asked May 13, 2022 in PHP by john ganales
...