Home >Backend Development >PHP Tutorial >PHP二维数组的表格输出

PHP二维数组的表格输出

WBOY
WBOYOriginal
2016-06-23 13:28:492081browse

<?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>";?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn