Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ucwordsvprintf>
Last updated: Tue, 19 Sep 2006

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

Example 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
?>




<ucwordsvprintf>
Last updated: Tue, 19 Sep 2006