Didn't you post this question already ? Don't double post. Anyway, here is the explanation again.
$string = file('test.php');
file() returns an array.$strings=processFile($string);
You are passing an array as a parameter to the function processFile.$lines = file($filename);
In function processFile, you are again trying to open an 'array' (instead of a file). Pass filename as a parameter for processFile function.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
What exactly are you trying to do with these 2 lines ?
$string = file('test.php');
$strings=processFile($string);
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
$string = file('test.php'); // $string is assign for the line of file.
That is where you are going wrong. If you want a string use file_get_contents . file() returns an array.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Its in the link I have provided.
$string = file_get_contents("test.php");
will read the entire file 'test.php' and returns it as a string.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356