note 86107 added to function.ftp-fget
| From: | broom at alturnanetworks dot com | Date: | Fri, 03 Oct 2008 11:49:51 +0000 |
| Subject: | note 86107 added to function.ftp-fget | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145014@lists.php.net to get a copy of this message | ||
/**
* Function returns contents via FTP connection and returns it as string (right version...)
*/
function ftp_get_contents ($conn_id, $filename) {
//Create temp handler:
$tempHandle = fopen('php://temp', 'r+');
//Get file from FTP:
if (@ftp_fget($conn_id, $tempHandle, $filename, FTP_ASCII, 0)) {
rewind($tempHandle);
return stream_get_contents($tempHandle);
} else {
return false;
}
}
----
Server IP: 83.137.20.135
Probable Submitter: 212.45.32.222 (proxied: 83.247.62.56)
----
Manual Page -- http://www.php.net/manual/en/function.ftp-fget.php
Edit -- https://master.php.net/note/edit/86107
Del: integrated -- https://master.php.net/note/delete/86107/integrated
Del: useless -- https://master.php.net/note/delete/86107/useless
Del: bad code -- https://master.php.net/note/delete/86107/bad+code
Del: spam -- https://master.php.net/note/delete/86107/spam
Del: non-english -- https://master.php.net/note/delete/86107/non-english
Del: in docs -- https://master.php.net/note/delete/86107/in+docs
Del: other reasons-- https://master.php.net/note/delete/86107
Reject -- https://master.php.net/note/reject/86107
Search -- https://master.php.net/manage/user-notes.php