Multidimensional array problems

Source: Internet
Author: User
How do you ask a master how to output an array of infinite classifications to a table at a hierarchical level?
Array ([0] = = Array ([cat_id] = 141 [Cat_name] = latest announcement) [1] = = Ar                Ray ([cat_id] = 117 [Cat_name] = Special topics related consultation [children] = = Array                            ([0] = = Array ([cat_id] = 118                        [Cat_name] = Moon phase Profit and loss) [1] = = Array                        ([cat_id] = 119 [Cat_name] = Tourbillon                            ) [2] = = Array ([cat_id] = 120            [Cat_name] = co-axial escapement)) [2] = = Array (                    [CAT_ID] = 104 [Cat_name] + bank Credit card special [children] = = Array ( [0] = ArraY ([cat_id] = [Cat_name] = China Merchants Bank Letter Card-related services) [1] = = Array ([CA T_ID] = 106 [Cat_name] = CMBC credit card related services) [2] =& Gt Array ([cat_id] = 107 [Cat_name]                            Business Bank credit card related services) [3] = = Array ( [CAT_ID] = 108 [Cat_name] = CCB credit card related services) [4  ] = = Array ([cat_id] = 109 [Cat_name]                            + = Traffic bank credit card related services) [5] = = Array ( [CAT_ID] =&Gt                        [Cat_name] = Everbright Bank credit card related services) [6] = = Array ([cat_id] = 111 [Cat_name] = ABC Credit card related Service) [7] = = Array ([cat_id ] = [Cat_name] + (CITIC Bank credit card related services) [8] = = Array ([cat_id] = 113 [Cat_name] = wide                            Issuing bank credit card related services) [9] = = Array ( [CAT_ID] = [Cat_name] + Shanghai bank Credit card related services) [1 0] = = Array ([cat_id] = [Cat_name ] = Huaxia bank Credit card related services                       ) [One] = Array ([cat_id] = [Cat_name] + Pudong bank credit card related services)) [3                ] = = Array ([cat_id] = 98 [cat_name] + SMS [children] = = Array                            ([0] = = Array ([cat_id] = 83                                [Cat_name] = mid-autumn message [children] = = Array                                            ([0] = = Array (                                        [CAT_ID] = [Cat_name] = mid-Autumn Festival to lovers SMS                                ) [1] = = Array (            [CAT_ID] = [Cat_name] = mid-Autumn Festival to customers SMS                                            ) [2] = = Array (                                        [CAT_ID] = [Cat_name] = mid-Autumn Festival to elders SMS                                        ) [3] = = Array ([cat_id] = [Cat_name] =& Gt                    Mid-Autumn Festival to colleagues/leader SMS))) [1] = = Array ([cat_id] = [C                                    At_name] = Christmas SMS [children] = = Array ( [0]= = Array ([cat_id] = 89                                    [Cat_name] = Christmas to Lovers SMS)  [1] = = Array ([cat_id]                                    [Cat_name] + Christmas Blessing SMS)                                            [2] = = Array (                                        [CAT_ID] = [Cat_name] = Christmas to elders SMS                                            ) [3] = = Array (                                 [CAT_ID] [cat_name] and Christmas funny SMS       )))) [4] = = Array ( [CAT_ID] = 141 [Cat_name] = [about us])


Reply to discussion (solution)

Please give the table style

In the ordinary form, TR wraps an array, and different levels of TR have a class-level value, similar to this

What's the use of this HTML code map?
Just draw one.

Are you a master? You can give me a clue.

Set your array in the $ar, then

Echo '
 
  
   
  '; Move_bar ($ar); Echo '
 
  
'; function Move_bar ($ar, $deep =0) { foreach ($ar as $row) { echo "$row [cat_name]\n"; if (Isset ($row [' Children '])) { Move_bar ($row [' Children '], $deep + 1);}}}






























Latest Announcements
Special topic related Consultation
Moon Phase Profit
Tourbillon
Co-Axial escapement
Bank Credit Card Specials
China Merchants Bank Credit card related services
Minsheng Bank credit card related services
ICBC Credit card related services
CCB Credit card related services
Bank of communications credit card related services
Everbright Bank credit card related services
ABC Credit card related services
CITIC Bank credit card related services
GF Bank Credit card related services
Shanghai Bank credit card related services
Huaxia Bank credit card related services
Credit card related services of Pudong Bank
Sms
Mid-Autumn Message
Mid-autumn message to lovers
Mid-Autumn message to customers
Mid-Autumn message to Elders
Mid-Autumn Festival to colleagues/leaders SMS
Christmas SMS
Christmas to Lovers texting
Christmas Blessing SMS
Christmas Message to Elders
Christmas Funny text message
About Us
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.