cvs: phpdoc-da /reference/strings/functions fprintf.xml

From: Date: Thu, 14 Oct 2004 19:49:03 +0000
Subject: cvs: phpdoc-da /reference/strings/functions fprintf.xml
Groups: php.doc.da 
Request: Send a blank email to doc-da+get-306@lists.php.net to get a copy of this message
holst Thu Oct 14 15:49:03 2004 EDT Added files: /phpdoc-da/reference/strings/functions fprintf.xml Log: Initial translatiopn http://cvs.php.net/co.php/phpdoc-da/reference/strings/functions/fprintf.xml?r=1.1&p=1 Index: phpdoc-da/reference/strings/functions/fprintf.xml +++ phpdoc-da/reference/strings/functions/fprintf.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: holst Status: ready --> <refentry id="function.fprintf"> <refnamediv> <refname>fprintf</refname> <refpurpose>Skriv en formateret streng til en fil</refpurpose> </refnamediv> <refsect1> <title>Beskrivelse</title> <methodsynopsis> <type>int</type><methodname>fprintf</methodname> <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>args</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> </methodsynopsis> <simpara> Skriver en streng produceret efter <parameter>format</parameter> til filen specificeret i <parameter>handle</parameter>. <parameter>format</parameter> er beskrevet i dokumentationen for <function>sprintf</function>. </simpara> <simpara> Returnerer længden på den udskrevne streng. </simpara> <simpara> Se også <function>printf</function>, <function>sprintf</function>, <function>sscanf</function>, <function>fscanf</function>, <function>vsprintf</function> og <function>number_format</function>. </simpara> </refsect1> <refsect1> <title>Eksempler</title> <para> <example> <title><function>fprintf</function>: nuludfyldte heltal</title> <programlisting role="php"> <![CDATA[ <?php if (!($fp = fopen('dato.txt', 'w'))) return; fprintf($fp, "%04d-%02d-%02d", $year, $month, $day); // vil udskrive den formaterede ISO-dato til dato.txt ?> ]]> </programlisting> </example> <example> <title><function>fprintf</function>: formater valuta</title> <programlisting role="php"> <![CDATA[ <?php if (!($fp = fopen('valuta.txt', 'w'))) return; $money1 = 68.75; $money2 = 54.35; $money = $money1 + $money2; // echo $money vil udskrive "123.1"; $len = fprintf($fp, '%01.2f', $money); // vil skrive "123.10" til valuta.txt echo "wrote $len bytes to currency.txt"; // use the return value of fprintf to determine how many bytes we wrote ?> ]]> </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 -->

« previous php.doc.da (#306) next »