2012-05-25 39 views
-5
<?php 
$ex = array 
(
    'Product' => array 
     (
      '0' => array 
       (
        'item_id' => '1', 
        'product_name' => 'Paine', 
        'product_description' => 'Intermediala', 
        'product_price' => '2', 
        'product_weight' => '300', 
        'product_quantity' => '300', 
        'product_photos ' => '0', 
        'product_colors ' => '', 
       ), 

      '1' => array 
       (
        'item_id' => '2', 
        'product_name' => 'Apa', 
        'product_description' => 'plata', 
        'product_price' => '4', 
        'product_weight' => '4000', 
        'product_quantity' => '', 
        'product_photos' => '0', 
        'product_colors' => '', 
       ), 
      '2' => array 
       (
        'item_id' => '3', 
        'product_name' => 'Apa', 
        'product_description' => 'minerala', 
        'product_price' => '4', 
        'product_weight' => '4000', 
        'product_quantity' => '', 
        'product_photos' => '0', 
        'product_colors' => '', 
       ) 

     ) 
); 



?> 
+0

'CREATE_TABLE($ EX)',沒有我是在開玩笑,沒有內置的功能,總得for循環 –

+0

確實認爲你可能需要一個更清楚一點...... – buymypies

+0

是的,你可以做到這一點與,或者foreach –

回答

0
<table border="1"><?php 
foreach ($ex['Product'] as $row) { 
    echo '<tr>'; 
    echo '<td>'.$row['item_id'].'</td><td>'.$row['product_name'].'</td>'; 
    echo '</tr>'; 
} 
?></table> 
相關問題