4
$list=array('Andaman and Nicobar'=>array( 'North and Middle Andaman', 'South Andaman', 'Nicobar' ), 'Andhra Pradesh' => array( 'Adilabad', 'Anantapur',));

以...的形式

[['North and Middle Andaman', 'South Andaman', 'Nicobar'],['Adilabad', 'Anantapur']]
4

2 回答 2

6
$tmp = json_encode($list);
echo $tmp;
于 2013-03-19T05:37:24.727 回答
0

您可以通过 php 打印多维数组,这里有一个简单的示例...

<?php
    $company = array(
        array('company','HCL', 'Microsoft','apple'),
        array('city ','Delhi','California','Newyork'),
        array('Type','IT','Software','Iphone')
    );
    ?>
    <table border="1">

    <?php
    foreach($company as $data)
    {
        echo '<tr>';
        foreach($data as $item)
        {
            echo "<td>$item</td>";


      }
        echo '</tr>';
    }
?>

不要对我说谢谢... :))

于 2013-03-19T07:14:11.550 回答