Javatpoint Logo
Javatpoint Logo

PHP fprint() Function

PHP fprint() function is used to write a formatted string to a stream. In another words we can say that this function format string to a specified output stream( file or database).


Parameter Description Required/Optional
stream Specify string where to write /output the string Required
Format Specify the string. Required
arg1 Specify the argument to be inserted at first. required
arg2 Specify the argument to be inserted at second. Optional
arg++ Specify the argument to be inserted at third, fourth etc. Optional

Example 1



Example 2


%b = 111010110111100110100010101 
%c = 2 
%d = 123456789 
%d = -123456789 
%e = 1.234568e+8 
%E = 1.234568E+8 

Example 3


%u = 123456789 
%u = 4171510507 
%f = 123456789.000000 
%F = 123456789.000000 
%g = 1.23457e+8 
%G = 1.23457E+8 
%o = 726746425 

Example 4


%s = 123456789 
%x = 75bcd15 
%X = 75BCD15 
%+d = +123456789 
%+d = -123456789 

Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA