首页 >后端开发 >php教程 >PHP二维数组的表格输出

PHP二维数组的表格输出

WBOY
WBOY原创
2016-06-23 13:28:492095浏览

<?php$arr1 = array("nokia" => array('lumia800','lumia900','lumia1520'),"apple" => array('iphone4s','iphone5c','iphone6s'),"msoft" => array('surface1','surface2','surface3'));$arr2 = array(array('lumia800','lumia900','lumia1520'),array('iphone4s','iphone5c','iphone6s'),array('surface1','surface2','surface3'));echo "<table border='1px'>";foreach($arr2 as $key=>$val){echo "<tr>";foreach($val as $detail){echo "<td>".$detail."</td>";}echo "</tr>";}echo "</table>";?>


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn