以下循环输出数组的示例代码:
php mysql如何 循环输出以下数组:
以下循环输出数组的示例代码:
<?php
$KeyArray = array(
0 => array(
"Key" => "中国",
"Href" => "<a href='中国'>中国</a>",
"ReplaceNumber" => 2),
1 => array(
"Key" => "人",
"Href" => "<a href='人'>人</a>",
"ReplaceNumber" => 1),
2 => array(
"Key" => "我",
"Href" => "<a href='我'>我</a>",
"ReplaceNumber" => 1),
3 => array(
"Key" => "呵呵",
"Href" => "<a href='呵呵'>呵呵</a>",
"ReplaceNumber" => 0));
echo '<table border="1">';
for($i=0;$i<count($KeyArray);$i++)
{
echo '<tr>';
foreach($KeyArray[$i] as $key=>$value)
{
echo "<td> $value </td>";
}
echo '</tr>';
}
echo '</table>';
?>2012-04-22
//以下是php中使用的while内容: <?php //连接MYSQL略。 //连接数据库略。 $sql_link="select * from link"; $query_link=mysql_query($请问,2012-04-22