i am trying to store data in a text file, something like an array into a text file using php instead of storing into mysql database.
for example here are the data to
I made a tiny library (~2 KB; <100 lines) that allows you to do just this: varDx
It has functions to write, read, modify, check and delete data. It implements serialization, and therefore supports all data types.
Here's how you can use it:
def('file.dat'); //define data file
$val1 = "this is a string";
$dx->write('data1', $val1); //writes key to file
echo $dx->read('data1'); //returns key value from file