Display an array in html table

前端 未结 4 1427
野的像风
野的像风 2021-01-03 13:06

I have this array:

Array
(
    [page] => Array
        (
            [0] => add
            [1] => edit
            [2] => delete
            [3]         


        
4条回答
  •  無奈伤痛
    2021-01-03 13:24

    This assumes that there are more pages than categories, and that they are held in $Array['pages'] and $Array['categories'] variables:

    print '';
    for ($i=0; $i< sizeof($Array['pages']; $i++)
    {
     print '';
    }
    print '
    PageCategory
    '; print $Array['pages'][$i]; print ''; if ($i < sizeof($Array['categories'])) print $Array['categories'][$i]; print '
    ';

    There are more elegant ways, but this should work.

提交回复
热议问题