note 33253 added to function.fwrite

From: Date: Fri, 20 Jun 2003 07:36:24 +0000
Subject: note 33253 added to function.fwrite
Groups: php.notes 
Request: Send a blank email to php-notes+get-50699@lists.php.net to get a copy of this message
the fwrite output striped the slashes if without length argument given, example: <?php $str = "c:\\01.txt"; $out = fopen("out.txt", "w"); fwrite($out, $str); fclose($out); ?> the out.txt will be: c:^@1.txt the '\\0' without escape will be '\0' ==> 0x00. the correct one is change fwrite to: fwrite($out, $str, strlen($str)); ---- Manual Page -- http://www.php.net/manual/en/function.fwrite.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33253 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33253&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33253&report=yes

« previous php.notes (#50699) next »