$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']]
答案 0 :(得分:6)
$tmp = json_encode($list);
echo $tmp;
答案 1 :(得分: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>';
}
?>
不要对我说... ... :))