I have a matrix of ID's and dates.
I want only the unique ID's with the biggest date, for example,
1, 6/1/2012,
2/6/12/2012,
3, 7/4/2011.
I can't figure out how to compare only the id's I want and then compare the dates to get the greatest date. See the line with the asterisks, there is a syntax error.
Thanks,
$myarr = array(
array('id', 'date'),
array(1, '05/01/2012'),
array(1, '06/01/2012'),
array(2, '06/01/2012'),
array(2, '06/12/2012'),
array(3, '07/1/2011'),
array(3, '07/04/2011')
);
echo "<br />";
print_r($myarr2);
var_dump($array_unique);
$i=0;
$unique = array_unique($myarr['id']);
while($unique[$i] ){
for ($row = 0; $row <6; $row ++){
for ( $column = 0; $column < 2; $column++ ){
$temp[$row][$column]=$myarr[$row][$column];
**** if ($temp[$column]= unique[$i] && $temp[$row]> $myarr[$column +1 ] ){
$temp[$row][$column] =$myarr[$row][$column+1];
}
}
$i++;
print_r($myTbl);
}//end while