可能重複:
Outputting array contents as nested list in PHP顯示PHP中的數組內容/ HTML
I have the array `array ([0] => array(1,2,3,4,5) [1] => array(6,7,8,9,10))` and I would like to display it like this:
<ul>
<li>
<a href=""/>FIRST ELEMENT OF THE array ==> 1</a>
<a href=""/>2ND ELEMENT OF THE TAB ==> 2</a>
<a href=""/>3THIRD ELEMENT==> 3</a>
<a href=""/>FORTH ELEMENT OF THE TAB ==> 4</a>
<a href=""/>FIFTH ELEMENT==> 5</a>
</li>
<li>
<a href=""/>6th ELEMENT==> 6</a>
<a href=""/>7th ELEMENT OF THE TAB ==> 7</a>
<a href=""/>8th ELEMENT==> 8</a>
<a href=""/>9th ELEMENT OF THE TAB ==> 9</a>
<a href=""/>10th ELEMENT OF THE TAB ==> 9</a>
</li>
</ul>
我如何在PHP中實現這一目標?我正在考慮創建一個array_slice
的子陣列。
似乎與您以前的問題100%一樣:http://stackoverflow.com/questions/4647715/outputting-array-contents-as-nested-list-in-php – 2011-01-10 16:15:56
-1:什麼費利克斯克林說過。 – 2011-01-10 16:19:28
完成我以前的評論:如果迄今爲止的答案沒有幫助你,你應該回答你有什麼問題和/或澄清你原來的問題。轉發問題不會改善它。 – 2011-01-10 16:22:12