View Single Post
Old 03-13-2005, 11:56 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
Hi Zach, welcome to the site.

It is really difficult to help you without seeing the code that you are opening the file with. I haven't explored the possibilities of getting fopen to work for you, but here is an alternative method.

file() reads the file given in the argument into an array. each line is a new element of the array. then you can impode the array into a new string. see the code below. if the file is not there, it will not generate an internal error.
PHP Code:
<?
// file() reads the target into an array
$file_array = @file("http://codenewbie.com/no-file-exists.php");

// create string
if(is_array($file)){
  
$file_text implode("\n",$file_array);
}

// now do other stuff with $file_text
?>
HTH
__________________
Mike
sde is offline   Reply With Quote