I'm coming from a perl background and need a little help about opening files with php and passing the data to an array so I can use the foreach() loop to use the data gathered. In perl I would do this.
open(INPUT,"< $file") or die "Couldn't open $file : $!\n";
while ($text = <INPUT>) {
chomp($text);
push(@values, $text);
};
and then I could use the foreach loop to search or use the data like->
foreach(@values)
{
etc....
}
How could I do this in php. I've tried to use
fgets() but I'm unable to pass the data into an array with array_push($array, $DATA) etc.. Any clues on how I could do this with php 4.2? Thanks ahead of time for any help.