note 99483 modified in function.fread by danbrown

From: Date: Thu, 19 Aug 2010 15:13:27 +0000
Subject: note 99483 modified in function.fread by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171851@lists.php.net to get a copy of this message
Simple function for getting FTP file contents without all the messy FTP connect scripts. <?php function ftp_get_contents($username,$password,$server,$file) { $login = "ftp://".$username.":".$password."@".$server."/".$file; $handle = fopen($login, "rb"); return stream_get_contents($handle); fclose($handle); } ?> --was-- <?php function ftp_get_contents($username,$password,$server,$file) { $login = "ftp://".$username.":".$password."@".$server."/".$file; $handle = fopen($login, "rb"); return stream_get_contents($handle); fclose($handle); } ?> Simple function for getting FTP file contents without all the messy FTP connect scripts. http://php.net/manual/en/function.fread.php

« previous php.notes (#171851) next »