- Add vfprintf().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165670 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Dave Barr 2004-08-07 18:21:07 +00:00
parent 461f6c292b
commit a08b515d3c

View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.vfprintf">
<refnamediv>
<refname>vfprintf</refname>
<refpurpose>Write a formatted string to a stream</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>vfprintf</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>string</type><parameter>format</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>args</parameter></methodparam>
</methodsynopsis>
<simpara>
Write a string produced according to <parameter>format</parameter>
to the stream resource specified by <parameter>handle</parameter>.
<parameter>format</parameter> is described in the documentation for
<function>sprintf</function>.
</simpara>
<simpara>
Operates as <function>fprintf</function> but accepts an array of
arguments, rather than a variable number of arguments.
</simpara>
<simpara>
Returns the length of the outputted string.
</simpara>
<simpara>
See also: <function>printf</function>,
<function>sprintf</function>,
<function>sscanf</function>, <function>fscanf</function>,
<function>vsprintf</function>, and
<function>number_format</function>.
</simpara>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
<example>
<title><function>vfprintf</function>: zero-padded integers</title>
<programlisting role="php">
<![CDATA[
<?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
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->