This worked below. Not ideal, but it gets it done quickly. Basically, pull the contents back into php, chop it, and then send it back down to the same file.
$fh = fopen($fname, 'w') or die("Cannot open file");
Note: This only works if you write the file and don't prompt the save/open menu.