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

search for in the

vprintf> <ucwords
[edit] Last updated: Fri, 14 Jun 2013

view this page in

vfprintf

(PHP 5)

vfprintf将格式化字符串写入流

说明

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

向由 handle 指定的流资源句柄中写入根据 format 格式化后的字符串。

作用与 fprintf() 函数类似,但是接收一个数组参数,而不是一系列可变数量的参数。

参数

handle

format

关于 format 的描述,参见 sprintf()

args

返回值

返回输出字符串的长度。

范例

Example #1 vfprintf(): 前导 0 的整数

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

vfprintf($fp"%04d-%02d-%02d", array($year$month$day));
// 将向 date.txt 写入格式化的 ISO 标准日期
?>

参见



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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites