Hi,
Sorry. I tried searching in the manual of php.net but couldn't find anything that could do what i want.
Hmm..okie..I have a file with many lines..how do i assign each line with a variable?
like $variable[0], $variable[1] etc....
thanks
| SitePoint Sponsor |





Hi,
Sorry. I tried searching in the manual of php.net but couldn't find anything that could do what i want.
Hmm..okie..I have a file with many lines..how do i assign each line with a variable?
like $variable[0], $variable[1] etc....
thanks
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
$array = file("/path/to.file");
http://www.php.net/manual/function.file.php





Hi,
Cool. Thanks..
So to access the different lines..I use:
$array[0] - for the first line and so on?
Coz php.net only showed the example to print out the entire array..thanks
-- Okay..thanks! I got it..yup...
<Edited by lynlimz on 11-28-2000 at 10:02 AM>
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
-- Albert Einstein
Bookmarks