View Single Post
Old 03-04-2005, 12:05   #8 (permalink)
Luke Redpath
Barney army!
 
Luke Redpath's Avatar
 
Join Date: Mar 2003
Location: London
Posts: 692
OK, is there a reason why you are doing this:

PHP Code:
$srcFile "$file";
$fileArray = @file($srcFile); 

Can you not just do this?

PHP Code:
$fileArray file($file); 

There shouldn't be any need to reset the array either.

You shouldn't surpress errors when you can prepare for them instead. Try checking the file $file exists using the file_exists() function. Put that in an if...else statement, so if the file exists, carry on, if it doesn't, print out an error.

Usually if you are trying to read a file using file() and then you are getting errors about $fileArray not being an array, it sounds like it cannot find the file you are trying to open.
__________________
  Reply With Quote