I'm using a flat-file CMS to save simple, user submitted form posts to a folder.
They contain the username of the user that submitted the post. And the text that they submitted in the form:
folders & files
(I've saved these submissions as .yaml, but another text format might be more efficient.)
I would use JSON for this instead of yaml, since there already is support for JSON in PHP. Yaml makes more sense if you have configuration files that needs to be really readable and that users should edit manually.
$content = json_decode(file_get_contents('/path/to/file'), true);
$content variable will now have the same content as your
$_POST variable did.
The second argument,
json_decode() makes sure that we get an associative array instead of an object.