All pastes #778573 Raw Edit

Someone

public php v1 · immutable
·published 2007-11-17 18:48 UTC
rendered paste body
function findLatest($items,$delimiter){	// get all counts	foreach($items as $item){		$delim[] = explode($delimiter,$item);		$count[] = count(explode($delimiter,$item));	}	// $delim[0][0] = 2	// $delim[0][1] = 6	// $delim[0][2] = 23	// $delim[0][3] = 8			// 2.5.2	// 2.6.2.7	// 5.2.1.7	foreach($delim as $item){		for($i=0;$i<max($count);++$i){			if(! isset($item[$i]))				$item[$i]=0;		}	}	$max = $delim[0];	foreach($delim as $item){		for($i=0;$i<max($count);++$i){			if($item[$i]>$max[$i]){				$max = $item;				break;			}						}	}	foreach($max as $num){		$latest .= $num.$delimiter;	}	$latest = substr($latest,0,-1);	echo $latest;return $latest;}