downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
Last updated: Mon, 16 Jul 2012


(PHP 5)

vfprintf -- Write a formatted string to a stream


int vfprintf ( resource handle, string format, array args )

Write a string produced according to format to the stream resource specified by handle. format is described in the documentation for sprintf().

Operates as fprintf() but accepts an array of arguments, rather than a variable number of arguments.

Returns the length of the outputted string.

See also: printf(), sprintf(), sscanf(), fscanf(), vsprintf(), and number_format().


例子 1. vfprintf(): zero-padded integers

if (!($fp = fopen('date.txt', 'w')))

vfprintf($fp, "%04d-%02d-%02d", array($year, $month, $day));
// will write the formatted ISO date to date.txt

 Last updated: Mon, 16 Jul 2012
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at:
Last updated: Thu Jul 7 19:13:47 2005 CST