多维数组,包含数组父子的信息

I'm trying to create a multidimensional array that contains an index that it contains some information, the items should be linked to its respective index.

Something like:

Category-01 (Image, url1, url2)
- 01 Product (name, url1, url2, url3)
- 02 Product (name, url1, url2, url3)
- 03 Product (name, url1, url2, url3)
Category-02 (Image, url1, url2)
- 04 Product (name, url1, url2, url3)
- 05 Product (name, url1, url2, url3)
- 06 Product (name, url1, url2, url3)

I've got so far (changing a file that I used as a basis) was:

<?php
$categories = array( 
    "01" => array( 
        array("name" => "01", "mirror1" => "#URL011", "mirror2" => "#URL021", "mirror3" => "#URL031",), 
        array("name" => "02", "mirror1" => "#URL012", "mirror2" => "#URL022", "mirror3" => "#URL032",), 
        array("name" => "03", "mirror1" => "#URL013", "mirror2" => "#URL023", "mirror3" => "#URL033",), 
    ), 
    "02" => array( 
        array("name" => "04", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
        array("name" => "05", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
    ),
    "03" => array( 
        array("name" => "06", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
        array("name" => "07", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
    ),
); 
// Setup the preprocessing. 
$numColumns = 99; 
$columnLength = array(); 
$columnData = array(); 
for ($i = 0; $i <= $numColumns; $i++)  
{ $columnLength[] = 0; $columnData[] = ''; } 
// Sort the category array 
ksort($categories); 
// Process our data 
foreach ($categories as $cname => $subcats) { 
    $minLength = $columnLength[0]; 
    $minIndex = 0; 
    for ($i = 1; $i < $numColumns; $i++) { 
        if ($columnLength[$i] < $minLength) { 
            $minLength = $columnLength[$i]; 
            $minIndex = $i; 
        } 
    } 
    $columnLength[$minIndex] += 1 + count($subcat); 
    $columnData[$minIndex] .= '- Categoria '.$cname; 
    foreach($subcats as $subcat) { 
        $columnData[$minIndex] .= 'Produto '.$subcat['name'].' | [<a title="Produto URL01.'.$subcat['name'].'" href="'.$subcat['mirror1'].'">URL01</a>] - [<a title="Produto URL02.'.$subcat['name'].'" href="'.$subcat['mirror2'].'">URL02</a>] - [<a title="Produto URL03.'.$subcat['name'].'" href="'.$subcat['mirror3'].'">URL03</a>]<br/>';


    };
};
// Display our data 
for ($i = 0; $i < $numColumns; $i++) { 
    echo $columnData[$i]; 
} 
?>

PS: I'm still learning and I am new to php.

what I would do is something like this:

$categories = array( 
    "Cat" => "01", "Image" => "image_url", "cat_link1" => "#CATURL01", "cat_link2" => "#CATURL02" => array( 
        array("name" => "01", "mirror1" => "#URL011", "mirror2" => "#URL021", "mirror3" => "#URL031",), 
        array("name" => "02", "mirror1" => "#URL012", "mirror2" => "#URL022", "mirror3" => "#URL032",), 
        array("name" => "03", "mirror1" => "#URL013", "mirror2" => "#URL023", "mirror3" => "#URL033",), 
    ), 
    "Cat" => "02", "Image" => "image_url", "cat_link1" => "#CATURL01", "cat_link2" => "#CATURL02" => array( 
        array("name" => "04", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
        array("name" => "05", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
    ),
    "Cat" => "03", "Image" => "image_url", "cat_link1" => "#CATURL01", "cat_link2" => "#CATURL02" => array( 
        array("name" => "06", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
        array("name" => "07", "mirror1" => "#URL01", "mirror2" => "#URL02", "mirror3" => "#URL03",), 
    ),
);

If that is possible and show the results as:

Category-01 (Image)
- 01 Product (name, url1, url2, url3)
- 02 Product (name, url1, url2, url3)
- 03 Product (name, url1, url2, url3)
catURL1, catURL2
Category-02 (Image)
- 04 Product (name, url1, url2, url3)
- 05 Product (name, url1, url2, url3)
- 06 Product (name, url1, url2, url3)
catURL1, catURL2 

But the script does not work as I want, it shows the products and information, but can not put information on the category / index than the title.

Thanks in advance for help.

With the amendments suggested by inti.

<?php
$categories = array(
    "01" => array(
        "Image" => "product01.jpg",
        "url1" => "SiteProduct",
        "url2" => "SiteSupport",
        "Products" => array(
            array("name" => "01", "url1" => "Site1.1", "url2" => "Site1.2", "url3" => "Site1.3"),
            array("name" => "02", "url1" => "Site2.1", "url2" => "Site2.2", "url3" => "Site2.3"),
            array("name" => "03", "url1" => "Site3.1", "url2" => "Site3.2", "url3" => "Site3.3"),
            array("name" => "04", "url1" => "Site4.1", "url2" => "Site4.2", "url3" => "Site4.3"),
            // and so on the Products...
        )
    ),// and so on the Categories...
    "02" => array(
        "Image" => "product02.jpg",
        "url1" => "SiteProduct",
        "url2" => "SiteSupport",
        "Products" => array(
            array("name" => "05", "url1" => "Site5.1", "url2" => "Site5.2", "url3" => "Site5.3"),
            array("name" => "06", "url1" => "Site6.1", "url2" => "Site6.2", "url3" => "Site6.3"),
            array("name" => "07", "url1" => "Site7.1", "url2" => "Site7.2", "url3" => "Site7.3"),
            array("name" => "08", "url1" => "Site8.1", "url2" => "Site8.2", "url3" => "Site8.3"),
            // and so on the Products...
        )
    ),
);
// Setup the preprocessing. 
$numColumns = 2; 
$columnLength = array(); 
$columnData = array(); 
for ($i = 0; $i <= $numColumns; $i++)  
{ $columnLength[] = 0; $columnData[] = ''; } 
// Sort the category array 
ksort($categories); 
// Process our data 
foreach ($categories as $cname => $cat) { 
    $minLength = $columnLength[0]; 
    $minIndex = 0; 
    for ($i = 1; $i < $numColumns; $i++) { 
        if ($columnLength[$i] < $minLength) { 
            $minLength = $columnLength[$i]; 
            $minIndex = $i; 
        } 
    } 
    $columnLength[$minIndex] += 1 + count($cat); 
    $columnData[$minIndex] .= '<p>'.$cname."</p>
"; 
    foreach($cat['Products'] as $subcat) { 
        $columnData[$minIndex] .= 'Product '.$subcat['name'].' - '.$subcat['url1'].' - '.$subcat['url2'].' - '.$subcat['url3']."<br/>
"; 
    } 
} 
// Display our data 
for ($i = 0; $i < $numColumns; $i++) { 
    echo '<div class="column'.($i+1).'">'.$columnData[$i]."</div>
"; 
} 
?>

You have to nest your products in the categories, by adding a Products value to each category. It will contain the products list. The array would look like this:

$categories = array(
    "01" => array(
        "Image" => "...",
        "url1" => "...",
        "url2" => "...",
        "Products" => array(
            array("name" => "...", "url1" => "...", "url2" => "...", "url3" => "..."),
            // and so on the Products...
        )
    ),
    // and so on the Categories...
);

And the processing of this array is somewhat the same, but note how foreach iterates $cat['Products']:

foreach ($categories as $cname => $cat)
{
    // here you raech the data of the category by $cat ...

    foreach ($cat['Products'] as $subcat)
    {
        // here you reach the data of the product by $subcat ...
    }
}