Need help creatig array of array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Everybody

I am getting ouput array from database in this structure:

Array (
[0] =>
       Array (

       [MAIN_CODE] => MAINTEST1
       [SUB_CODE] => SUBTEST1
       [MAINCODE_STATUS] => N
       [SUBCODE_STATUS] => N
       [CODE_TEST] => YES
           )
[1] => Array (

       [MAIN_CODE] => MAINTEST1
       [SUB_CODE] => SUBTEST2
       [MAINCODE_STATUS] => N
       [SUBCODE_STATUS] => N
       [CODE_TEST] => NO
           )
)
but I want the create output for above array into different array structure that below I mentioned:

Array(
     [MAINTEST1] =>
               Array(
                   MAINCODE_STATUS => N
                   SUBTEST1 =>
                           Array(
                               SUBCODE_STATUS => N
                               CODE_TEST => YES
                                 )
                   SUBTEST2 =>
                           Array(
                              SUBCODE_STATUS => N
                              CODE_TEST => NO
                                )

                      )
)

Can anybody help me how create this array using PHP.

Regards
Tanmoy


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux