Get array based on unique values within another array?
I have an array of arrays. One of the fields within in the inner array needs to be unique so that when I show the results it only displays unique entries.
array_unique is available but it looks like that only works on single dimension arrays. I could probably do a comparison operation on while iterating through the array but that seems like the least efficient way to do it.
The way the data is stored in the database(not my design) is tricky and I wont be able to just pull in the distinct results using sql.
I have an array that a Console command iterates over frequently looking for new entries. I do an
array_pluck and grab the id's and creates a comparision array , then do an in in_array check over the two arrays to find distinct.
probably better ways to be done but this works for me.