As usual, I will dissect your code 😉
function getcontents($file) { # i doubt it's a rule or anything, but i thought only class methods were supposed to be capitalized?
return implode("\n", file($file)) or return FALSE;
}
function putcontents($file, $string) {
$fp = fopen($file, 'w') or return FALSE;
fwrite($fp, $string);
fclose($fp);
return TRUE;
}
the first line of putcontents could also be something like:
if(($fp = fopen($file, 'w')) === FALSE) return FALSE;