[Fwd: note 36722 added to function.file-get-contents]

From: Date: Mon, 20 Oct 2003 11:03:26 +0000
Subject: [Fwd: note 36722 added to function.file-get-contents]
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-21585@lists.php.net to get a copy of this message
The note have been added again, without the Btw part (the manual notes are not the good place for this) didou -------- Original Message -------- Subject: note 36722 added to function.file-get-contents Date: 20 Oct 2003 11:02:15 -0000 From: webmaster@ragnarokonline.de To: php-notes@lists.php.net Newsgroups: php.notes Users of PHP4 < 4.3.0 can use the following: It is binary safe and it can be used for external files. <?php if (!function_exists("file_get_contents")) { function file_get_contents($filename, $use_include_path = 0) {
    $data = ""; // just to be safe. Dunno, if this is really needed
    $file = @fopen($filename, "rb", $use_include_path);
    if ($file) {
      while (!feof($file)) $data .= fread($file, 1024);
      fclose($file);
    }
    return $data;
} } ?> ---- Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit        -- http://master.php.net/manage/user-notes.php?action=edit+36722
Delete      -- http://master.php.net/manage/user-notes.php?action=delete+36722&report=yes
Reject      -- http://master.php.net/manage/user-notes.php?action=reject+36722&report=yes
Search      -- http://master.php.net/manage/user-notes.php


« previous php.mirrors (#21585) next »