1
2
3
4
5
6
7
function sanitize($contents) {
	$contents = str_replace("\r\n","\n",$contents); //converts win newlines to nix
	$contents = str_replace("\n\n","\n",$contents); //removes double newlines
	$contents = str_replace("\t","",$contents); //removes tabs

	return $contents;
}