I have a little php script that removes the last character of a file.
$contents = file_get_contents($path); rtrim($contents); $contents = substr($contents, 0
Try this
$fh = fopen($path, 'r+') or die("can't open file"); $stat = fstat($fh); ftruncate($fh, $stat['size']-1); fclose($fh);
For more help see this