It is rather a request for quick advice, since it is very difficult for me to believe that there is no native function for this task. Consider the following:
array =>
(0) => array("id" => "1", "groupname" => "fudge", "etc" => "lorem ipsum"),
(1) => array("id" => "2", "groupname" => "toffee", "etc" => "lorem ipsum"),
(2) => array("id" => "3", "groupname" => "caramel", "etc" => "lorem ipsum")
)
What I'm looking for is a new array that uses only "groupname", so it will be equal to:
array =>
(0) => "fudge",
(1) => "toffee",
(2) => "caramel"
)
I know that it is very simple to achieve a recursive traversal of the original array, but I was wondering if there is a much simpler way to achieve the final result. I searched the internet and the PHP manual and found nothing
Thank you for reading this question simon
Simon source
share