note 61288 added to function.file-put-contents

From: Date: Mon, 30 Jan 2006 13:51:49 +0000
Subject: note 61288 added to function.file-put-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-102727@lists.php.net to get a copy of this message
From previous comment: for php4 <?php function file_put_contents($file, $string) { $f=fopen($file, 'a+'); ftruncate($f, 0); fwrite($f, $string); fclose($f); } ?> why not call fopen with 'w' instead of 'a+'? : <?php function file_put_contents($file, $string) { $f=fopen($file, 'w'); fwrite($f, $string); fclose($f); } ?> ---- Server IP: 83.137.200.2 Probable Submitter: 217.118.40.143 ---- Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61288 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61288&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61288&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102727) next »