I\'d think there was a question on this already, but I can\'t find one. Maybe the solution is too easy... Anyway, I have a flat-file and want to let the user change the valu
A very easy way would it be to use str_replace() on the whole file:
// read the file
$file = file_get_contents('filename.csv');
// replace the data
$file = str_replace('folder|oldValue', 'folder|newValue', $file);
// write the file
file_put_contents('filename.csv', $file);
That should work as only one user the file at a time. But a database is always a better idea. If you need CSV, it's better to have an additional DB to CSV script than only a CSV file.