Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello together,
What is the best and performent solution for an array_unique function for following array structure? Something recursive or a further temporary array?Code: Select all
$arrStackHeader[] = array("plural" => "machines" ,"singular" => "machine");
$arrStackHeader[] = array("plural" => "molding machines" ,"singular" => "machine");Following condition should be fulfilled:
1. Relevant for determining unique rows is the column "singular".
2. Elements that are on top of the stack ([0]) have absolute priority.
Original array:
Code: Select all
Array
(
[0] => Array
(
[plural] => machines
[singular] => machine
)
[1] => Array
(
[plural] => molding machines
[singular] => machine
)
)Code: Select all
Array
(
[0] => Array
(
[plural] => machines
[singular] => machine
)
)Appreciate your help and your suggestions!
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]