★ wanayoo — archive 1999 http://fr.php.net/manual/fi/function.fwrite.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousftruncateglobnext
Last updated: Tue, 28 May 2002
view the printer friendly version or the printer friendly version with notes or change language to English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Polish | Romanian | Russian | Slovak | Spanish | Swedish | Turkish

fwrite

(PHP 3, PHP 4 >= 4.0.0)

fwrite -- Binary-safe file write

Description

int fwrite ( int fp, string string [, int length])

fwrite() writes the contents of string to the file stream pointed to by fp. If the length argument is given, writing will stop after length bytes have been written or the end of string is reached, whichever comes first.

fwrite() returns the number of bytes written, or -1 on error.

Note that if the length argument is given, then the magic_quotes_runtime configuration option will be ignored and no slashes will be stripped from string.

Huomaa: On systems which differentiate between binary and text files (i.e. Windows) the file must be opened with 'b' included in fopen() mode parameter.

See also fread(), fopen(), fsockopen(), popen(), and fputs().

User Contributed Notes
fwrite
add a note about notes
sean at sbdconsultants dot com
08-Nov-2002 07:53

The error handling in the example is not consistent with the documented way in which error conditions are indicated by the return result.

Error conditions are indicated as a -1 return value; yet the example checks for a FALSE (i.e.: zero) value.

add a note about notes
previousftruncateglobnext
Last updated: Tue, 28 May 2002
show source | credits | stats | mirror sites
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Sat Nov 23 04:10:11 2002 CET