Read Content from a .txt file

#1
[eluser]cinewbie81[/eluser]
Hi guys,

Again, it's CI irrelevant topic again ... but i just dont know how to get it done..

I have this myfile.txt located at /var/www/myproject/myfile.txt file as following:

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

Now in my Controller, i want to assign each of the value from myfile.txt to a variable .. So that i have something like :
Code:
$studentID = "S0001";
$studentName = "Francis Light";
$Age = "20";
$Desc = "Francis light is bla bla bla"

How can i read from the file and assign it to the variable ? Anyone ??

Thanks in advance


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.