PHP providing a closure to determine uniqueness of an item in an array

leticiasa

New Member
Quick question: is there a way to provide a closure in PHP to some equivalent function to the array_unique function so that you can specify your own comparison closure to be used when comparing two items in the array? I have an array of class instances (which may contain duplicates) and want to tell PHP to use particular logic to determine uniqueness.PHP provides this with sorting using the usort() method - just wondering if it is also available for uniqueness checks. Thanks!
 
Back
Top