allinurl Posted July 21, 2008 Share Posted July 21, 2008 Hello, I have the following array where Im trying to display just one element for the first column, what I mean is not to display duplicate elements of the first column. What would be the best way to do this? Thanks $array = array ( array("test foo", 10, 795, "cc"), array("hello bar again", 10, 795, "dd"), array("test foo", 10, 795, "cc"), array("test foo", 10, 795, "cc"), array("hello bar again", 10, 795, "bb"), array("mike bar", 10, 775, "aa"), array("mike bar", 10, 775, "aa") ); Link to comment https://forums.phpfreaks.com/topic/115841-duplicate-elements-array-perhaps-using-regexp/ Share on other sites More sharing options...
redarrow Posted July 21, 2008 Share Posted July 21, 2008 array_unique() Link to comment https://forums.phpfreaks.com/topic/115841-duplicate-elements-array-perhaps-using-regexp/#findComment-595521 Share on other sites More sharing options...
allinurl Posted July 21, 2008 Author Share Posted July 21, 2008 thanks man, thats what I was looking for!! Link to comment https://forums.phpfreaks.com/topic/115841-duplicate-elements-array-perhaps-using-regexp/#findComment-595529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.