【发布时间】:2009-10-15 13:30:01
【问题描述】:
我已经设法让我的第一个数组工作了,但是无论我尝试了多少代码示例,我都无法遍历每个数组行并将三列/元素回显到一个
我的数组的 var_dump 是:-
array(27) { [3]=> array(3) { ["id"]=> string(3) "295" ["title"]=> string(24) "ask.sqlservercentral.com" ["questions"]=> int(57) } [4]=> array(3) { ["id"]=> string(3) "287" ["title"]=> string(36) "LensFail.com - Photography Questions" ["questions"]=> int(42) } [2]=> array(3) { ["id"]=> string(3) "437" ["title"]=> string(12) "VideoWTF.com" ["questions"]=> int(37) } [13]=> array(3) { ["id"]=> string(2) "92" ["title"]=> string(8) "Moms4Mom" ["questions"]=> int(36) } [9]=>
我尝试过使用它,但没有得到预期的结果:-
foreach($results as $key=>$value)
{
echo $key.": ".$value;
}
有人可以帮忙提供一个循环遍历数组并将 ID、标题、问题回显到 a 的代码示例
提前感谢您的帮助。
乔纳森
【问题讨论】: