超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<ucwordsvprintf>
Last updated: Fri, 22 Jun 2007

vfprintf

(PHP 5)

vfprintf -- Write a formatted string to a stream

Description

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().

Examples

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

<?php
if (!($fp = fopen('date.txt', 'w')))
   return;

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




add a note add a note User Contributed Notes
vfprintf
There are no user contributed notes for this page.

<ucwordsvprintf>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22