求大神指教!
第1个回答 2015-04-04
<table border='1' cellpadding='0' cellspacing='0'><tr>
<?php
$arr=array(
"web"=>array(
"weburl"=>"",
"webname"=>"百度一下",
"webconfig"=>"xml"
),
"users"=>array(
"username"=>"用户名",
"password"=>"密码",
"Email"=>"伊妹儿",
)
);
echo "<tr bgcolor='#33ff33'><td>网站</td><td>用户</td></tr>";
foreach ($arr as $temp){
echo "<td>";
echo "<table >";
foreach ($temp as $tp){
echo "<tr bgcolor='#ccff33'><td>".$tp."<tr></td>";
}
echo "</table></td>";
}
?></tr></table>追问
<?php
$arr=array(
"web"=>array(
"weburl"=>"",
"webname"=>"百度一下",
"webconfig"=>"xml"
),
"users"=>array(
"username"=>"用户名",
"password"=>"密码",
"Email"=>"伊妹儿",
)
);
echo "<tr bgcolor='#33ff33'><td>网站</td><td>用户</td></tr>";
foreach ($arr as $temp){
echo "<td>";
echo "<table >";
foreach ($temp as $tp){
echo "<tr bgcolor='#ccff33'><td>".$tp."<tr></td>";
}
echo "</table></td>";
}
?></tr></table>追问
如何变量混合数组??
本回答被网友采纳第2个回答 2015-04-04
一维还用循环么
第3个回答 2015-04-04
foreach 一下,放到th里面,轻松解决