I am having my script import source from a file, and at the end of each string it is inserting a line. (ie) I have a file that looks like this:
John
Marie
Lou
#EOF
And then I want to put each line into an array called $Names[#]... but when I do something like
echo("$name[1] $name[2]");
it returns
"John
Marie"
See what I mean? Here is my code:
$host1 = fopen("$filename", "r");
$hosts = array();
$count2 = 1;
while (!feof ($host1)) {
$line = fgets ($host1, 1024);
$hosts[$count2] = $line;
$count2 = $count2 + $count2;
}
fclose($host1);