数组的指针有关问题

WBOY
Release: 2016-06-13 12:36:47
Original
727 people have browsed it

数组的指针问题

<br />
<?php<br />
<br />
$arr = array(<br />
	array(<br />
		'id'=>1,<br />
		'title'=>'测试1',<br />
	),<br />
	array(<br />
		'id'=>2,<br />
		'title'=>'测试2',<br />
	),<br />
	array(<br />
		'id'=>3,<br />
		'title'=>'测试3',<br />
	),<br />
	array(<br />
		'id'=>4,<br />
		'title'=>'测试4',<br />
	),<br />
	array(<br />
		'id'=>5,<br />
		'title'=>'测试5',<br />
	),<br />
);<br />
<br />
while(list($k, $v) = each($arr)){<br />
<br />
	print_r(current($arr));<br />
<br />
	echo '<br>';<br />
<br />
}<br />
<br />
Copy after login


循环一个二维数组,使用 current 返回当前元素,为啥从第2个元素开始的呢? 想要从1开始怎么做,请前辈指教

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!