I have a multidimensional array and I want to remove a array record on duplication of specific index value and I have to use a condition as well before discarding a record.
for example my array is as below
array {
[0]
{ ["name"]=> string(12) "A1" ["status"]=> string(16) "Not Available" ["statusid"]=>4 ["num"]=> string(7) "33" }
[1]
{ ["name"]=> string(15) "A2" ["status"]=> string(16) "Available" ["statusid"]=>1 ["num"]=> string(7) "39" }
[2]
{ ["name"]=> string(21) "A3" ["status"]=> string(16) "Busy" ["statusid"]=>3 ["num"]=> string(7) "55" }
[3]
{ ["name"]=> string(12) "A4" ["status"]=> string(16) "Available" ["statusid"]=>1 ["num"]=> string(7) "54" }
[4]
{ ["name"]=> string(18) "A5" ["status"]=> string(16) "Busy" ["statusid"]=>3 ["num"]=> string(7) "33" }
}
In above array I want to check duplication on "num" if it repeats then I want to remove the record which has higher "statusid" like in above record "num" is repeating at [0][num] and [4][num] but i want to keep row [4] as its [4][statusid] is less then [0][statusid].