[英]How do I fill an array inside a while loop and get new scope each iteration?
[英]How to create anchor link to each array inside while loop
單擊標題值時,我想顯示內容。 下面顯示的代碼顯示了幾個標題,因此,如果我單擊其中一個,則要顯示其中的內容。
<ul class="" role="menu" aria-labelledby="dLabel">
<?php
while($row = mysql_fetch_array($page) ) {
?>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="">
<?php
echo $row['title'];
}?>
<ul class="" role="menu" aria-labelledby="dLabel">
<?php
while($row = mysql_fetch_array($page) ) {
?>
<li role="menuitem" tabindex="-1">
<a href="">
<?php
echo $row['title'];
?>
</a>
</li>
<?php
}
?>
</ul>
<ul class="" role="menu" aria-labelledby="dLabel">
<?php
while($row = mysql_fetch_array($page) ) {
?>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="">
<?php
echo $row['title'];
?>
</a></li>
<?php
}?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.