Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Array
(
    [entry] => Array
        (
            [0] => Array
                (
                    [id] => 20328809
                    [list_name] => Acc
                    [name__list] => Array
                        (
                            [0] => Array
                                (
                                    [name] => name
                                    [value] => Jungle Inc
                                )

                            [1] => Array
                                (
                                    [name] => billing
                                    [value] => NYC
                                )

                            [2] => Array
                                (
                                    [name] => address
                                    [value] => USAI
                                )

                        )

                )

            [1] => Array
                (
                    [id] => 328b22a6
                    [list_name] => Acc
                    [name__list] => Array
                        (
                            [0] => Array
                                (
                                    [name] => name
                                    [value] => Dhund Hotels
                                )

                            [1] => Array
                                (
                                    [name] => billing
                                    [value] => CA
                                )

                            [2] => Array
                                (
                                    [name] => address
                                    [value] => USAI
                                )

                        )

                )

        )

  )

Need to sort this array I have tried this solution

foreach($array['entry'] as $sortingFirst =>$key)
                        {

                                 echo "<br /><b>record - ". $sortingFirst."</b>" ;
                                 foreach($key['name_list'] as $red => $key1)
                                  {

                                        {    
                                                while (list($key2, $value2) = each ($key1)) 
                                                {

                                                    echo "$key2: $value2 <br />";
                                                    echo "<pre>";
                                                    echo "</pre>";    
                                                }
                                   }
                        }

i want to display output like this format

Jungle_Inc NYC  USAI
Dhund_Hotels CA USAI

I browsed through other similar questions, and I've been trying to solve it with array_walk_recursive but I couldn't get my head around it

share|improve this question
 
possible duplicate of How do I Sort a Multidimensional Array in PHP –  Jon yesterday
 
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.