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

[eluser]cinewbie81[/eluser]
I take Rick's advise and use .ini solution .. The code is like following

Code:
$ini_array = parse_ini_file(/path/to/myFile.ini);

$StudentID = $ini_array['StudentID'];
$StudentName = $ini_array['StudentID'];
$Age = $ini_array['Age'];
$Desc = $ini_array['Description'];

It's works ..
Anyway, if the value of some of those field contain the "=" character (Refer to the ini file below), it give me parsing error

Here's the sample .ini file that will cause the error :

Code:
StudentID = "S0001"
StudentName = "Francis Light"
Age = 20
Description = "Francis light = is bla bla bla"

Any solution


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