Nice job matt. I originally started to use fopen,fclose,fwrite and so on for my original project(which i still haven't fully restored. I'll get to it one of these years. For me however, i found it alot easier to use file_get_contents and file_put_contents because the other methods are good it's just that i was using my system to edit pages, and knowing where to edit a line got annoying, i just truncated the file and used file_put_contents(then i found out file_put_contents does that for you).

for those who are a bit confused by the whole fopen() and so on, just use file_get_contents() instead.