> if( !($fd = @fopen($ftp_url, "r")) ){
> $error = true;
> $error_msg = "Unable to connect to server.";
> }
> else {
> $file_contents = fread($fd, 10);
> fclose($fd);
> }
>
> if( empty($file_contents) ){
> $error = true;
> $error_msg = "Did not read file.";
> }
>
>
> The problem is
I'm having some trouble reading a text file from a remote server into a
string. The code is as follows:
if( !($fd = @fopen($ftp_url, "r")) ){
$error = true;
$error_msg = "Unable to connect to server.";
}
else {
$file_contents = fread($fd, 10);
fclose($fd);
}
if( empty($file_content
2 matches
Mail list logo