problem on php file read-write-edit
Posted: Tue Jun 21, 2011 4:33 am
hi, first let it be known to anyone answering my question that i am n00b to the php coding but i have been playing with php for more than a year or so, now i have a problem:
i have a structure like this(as i learnt in C++, i guess there is something similar in php too):
Struct student
{
int roll;
char name;
int class;
}
i want to write or append an object of this structure in a file named 'datafile.dat' on my server and read it later to display some specific object in other php file. i may have to edit the object data too some time. so is there any code for this?.. yeah there are a lot, but i cant get anything. so only codes and explanations needed here. if you can please tell me how to read write and edit a structure in to a file through php on server. (many would say i would have used database for it, but man, mind it, i have no extra bucks). thanks in advance.
i have a structure like this(as i learnt in C++, i guess there is something similar in php too):
Struct student
{
int roll;
char name;
int class;
}
i want to write or append an object of this structure in a file named 'datafile.dat' on my server and read it later to display some specific object in other php file. i may have to edit the object data too some time. so is there any code for this?.. yeah there are a lot, but i cant get anything. so only codes and explanations needed here. if you can please tell me how to read write and edit a structure in to a file through php on server. (many would say i would have used database for it, but man, mind it, i have no extra bucks). thanks in advance.