brooksh Posted March 18, 2012 Share Posted March 18, 2012 I'm pulling data from an xml file and I'm getting a lot of duplicates. How can I remove the duplicates from the query? foreach($xml->category->subcategory as $category){ echo $category[id]; }//end foreach Link to comment https://forums.phpfreaks.com/topic/259195-duplicate-xml-data-returned-how-to-list-ony-unique-data/ Share on other sites More sharing options...
brooksh Posted March 18, 2012 Author Share Posted March 18, 2012 foreach($xml->category->subcategory as $category){ $filter_categoryid[] = trim($category['categoryId']); }//end foreach $filter_categoryid = array_unique($filter_categoryid); Link to comment https://forums.phpfreaks.com/topic/259195-duplicate-xml-data-returned-how-to-list-ony-unique-data/#findComment-1328742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.