<?php
class testClass {
	function formatTS($input, $ln)	{
		$input = ereg_replace('^[^'.chr(10).']*.','',$input);
		$input = chop($input);
		$cArr = explode(chr(10),$input);
		
		reset($cArr);
		$n = ceil(log10(count($cArr)));
		$lineNum='';
		while(list($k,$v)=each($cArr))	{
			if ($ln)	$lineNum = sprintf('% '.$n.'d',($k+1)).':   ';
			$v=htmlspecialchars($v);
			$cArr[$k] = str_replace(' ',chr(160),$lineNum.$v);
		}
		$output = implode($cArr, '<br />').'<br />';
		$output = '<font face="verdana" size="1" color="maroon">'.$output.'</font>';
		return $output;
	}
}
?>
