severndigital Posted November 30, 2009 Share Posted November 30, 2009 i have an array $items = array(2008,2008,2008,2009,2010,2007,2009,2007,2010); //i would like to end up with an array like this $newitems = array(2007,2008,2009,2010); not sure how to do this. thanks in advance, C Link to comment https://forums.phpfreaks.com/topic/183477-discarding-duplicates-in-an-array/ Share on other sites More sharing options...
premiso Posted November 30, 2009 Share Posted November 30, 2009 array_unique should be the answer to your question. Link to comment https://forums.phpfreaks.com/topic/183477-discarding-duplicates-in-an-array/#findComment-968488 Share on other sites More sharing options...
severndigital Posted November 30, 2009 Author Share Posted November 30, 2009 yeah .. i just found it at php.net ... i need to look harder before i post. thanks though. C Link to comment https://forums.phpfreaks.com/topic/183477-discarding-duplicates-in-an-array/#findComment-968489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.