码迷,mamicode.com
首页 > 编程语言 > 详细

获取到数组的值

时间:2017-06-07 10:06:15      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:eset   for   ++   current   数组   count   获取   font   while   

/*
* 获取到数组的值
* */
$arr = array(‘zs‘=>‘103‘);

$count = count($arr);

for ($i=0;$i<$count;$i++)
{
list($k,$v) = each($arr);
}

for ($i=0;$i<$count;$i++)
{
$v = current($arr);
$k = key($arr);
}

echo reset ($arr);//直接取值

while (list($key, $value) = each ($arr)) {
echo "Key: $key; Value: $value<br>\n";
}

获取到数组的值

标签:eset   for   ++   current   数组   count   获取   font   while   

原文地址:http://www.cnblogs.com/ghjbk/p/6955243.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!