note 95751 added to function.fopen
| From: | Pastix at osu1 dot php dot net | Date: | Wed, 20 Jan 2010 11:04:06 +0000 |
| Subject: | note 95751 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165127@lists.php.net to get a copy of this message | ||
If fopen() has been disabled for security reasons, is possible a porting FROM:
$f=fopen($file,'rb');
$data='';
while(!feof($f))
$data.=fread($f,$size);
fclose($f);
TO:
$data = file_get_contents($file); // (PHP 4 >= 4.3.0, PHP 5)
and also a porting FROM:
$f = fopen($file,'wb');
fwrite($f,$content,strlen($content));
fclose($f);
TO:
$f=file_put_contents($file, $content); // (PHP 5)
For detail read the php manual.
----
Server IP: 69.147.83.197
Probable Submitter: 93.42.18.223
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- https://master.php.net/note/edit/95751
Del: integrated -- https://master.php.net/note/delete/95751/integrated
Del: useless -- https://master.php.net/note/delete/95751/useless
Del: bad code -- https://master.php.net/note/delete/95751/bad+code
Del: spam -- https://master.php.net/note/delete/95751/spam
Del: non-english -- https://master.php.net/note/delete/95751/non-english
Del: in docs -- https://master.php.net/note/delete/95751/in+docs
Del: other reasons-- https://master.php.net/note/delete/95751
Reject -- https://master.php.net/note/reject/95751
Search -- https://master.php.net/manage/user-notes.php