php-doc-en/reference/filesystem/functions/fwrite.xml

72 lines
2.4 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.fwrite">
<refnamediv>
<refname>fwrite</refname>
<refpurpose>Binary-safe file write</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>fwrite</methodname>
<methodparam><type>int</type><parameter>fp</parameter></methodparam>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>fwrite</function> writes the contents of
<parameter>string</parameter> to the file stream pointed to by
<parameter>fp</parameter>. If the <parameter>length</parameter>
argument is given, writing will stop after
<parameter>length</parameter> bytes have been written or the end
of <parameter>string</parameter> is reached, whichever comes
first.
</simpara>
<simpara>
<function>fwrite</function> returns the number of bytes
written, or -1 on error.
</simpara>
<simpara>
Note that if the <parameter>length</parameter> argument is given,
then the <link
linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>
configuration option will be ignored and no slashes will be
stripped from <parameter>string</parameter>.
</simpara>
<note>
<para>
On systems which differentiate between binary and text files
(i.e. Windows) the file must be opened with 'b' included in
<function>fopen</function> mode parameter.
</para>
</note>
<simpara>
See also <function>fread</function>, <function>fopen</function>,
<function>fsockopen</function>, <function>popen</function>, and
<function>fputs</function>.
</simpara>
</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
-->