faqts : Computers : Programming : Languages : PHP : Function Libraries : PHP Related

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 2 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

how do I read a text file into an array?

May 21st, 2004 12:49
Julio Nobrega, Tam bouma,


Use the file() funtion:

$array = file('filename.extension');

keys will be the line number (starting with zero) and the values will be
the line contents.