Breathing Spring

Archive for April, 2009

get unique value from XML array

No Comments »

April 1st, 2009 Posted 9:08 am

this should work best as far as I know and tried..I used the serialize because oddly it couldnt compare strings

hope it maybe help someone there that needs it

$new=array();

$exclude = array("");

foreach ($myItems as $item)
{
if (!in_array(serialize($item->fileName) ,$exclude))
{
$new[] = $item;
array_push($exclude, serialize($item->fileName));
}
}

Posted in php