PHP: vfprintf - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

vprintf ucwords

Last updated: Sat, 27 Jan 2007

view this page in

# 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 User Contributed Notes
vfprintf
There are no user contributed notes for this page.
vprintf ucwords

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST