Welcome Guest, Not a member yet? Register   Sign In
Read Content from a .txt file
#7

[eluser]Rick Jolly[/eluser]
[quote author="inparo" date="1200502072"]I hope you're not trying to store data this way. Having it in a db would be a lot more efficient.
[/quote]
Actually, I think the file is more efficient in this case. No database operations are required.

cinewbie81, if you are able to store your data in "ini" format you could use php's parse_ini_file() which would return an associative array. Example myfile.txt in ini format:
Code:
StudentID = "S0001"
StudentName = "Francis Light"
Age = 20
Description = "Francis light is bla bla bla"


Messages In This Thread
Read Content from a .txt file - by El Forum - 01-16-2008, 04:41 AM
Read Content from a .txt file - by El Forum - 01-16-2008, 04:47 AM
Read Content from a .txt file - by El Forum - 01-16-2008, 07:36 AM
Read Content from a .txt file - by El Forum - 01-16-2008, 07:53 AM
Read Content from a .txt file - by El Forum - 01-16-2008, 07:11 PM
Read Content from a .txt file - by El Forum - 01-16-2008, 07:46 PM
Read Content from a .txt file - by El Forum - 01-16-2008, 09:46 PM
Read Content from a .txt file - by El Forum - 01-16-2008, 10:17 PM
Read Content from a .txt file - by El Forum - 01-17-2008, 12:30 AM
Read Content from a .txt file - by El Forum - 01-17-2008, 02:02 AM
Read Content from a .txt file - by El Forum - 01-17-2008, 07:28 PM
Read Content from a .txt file - by El Forum - 01-17-2008, 08:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB