Blogger Information
Blog 6
fans 0
comment 0
visits 5185
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
常用操作数组函数
Pythonxzm
Original
867 people have browsed it
<?php
$t=array(
   '我们',
   'yy'=>'永远',
   'dbg'=>'需要不断奋进',
   'djn'=>'才能开创未来'
   );


//读取数组的值
echo current($t).'<br />';
//读取数组的键
echo key($t).'<br />';

//向后移动一下
next($t);

//再读值和键
echo current($t).'<br />';

echo key($t).'<br />';


//向后移动一下
next($t);
echo current($t).'<br />';

echo key($t).'<br />';


//向前移动一下
prev($t);
echo current($t).'<br />';
echo key($t).'<br />';


//移到末尾
end($t);
echo current($t).'<br />';
echo key($t).'<br />';

//移至开始处
reset($t);
echo current($t).'<br />';

echo key($t).'<br />';


//销毁数组
unset($t);
var_dump($t);
?>

QQ截图20170923221128.pngQQ截图20170923221226.pngQQ截图20170923221226.png

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!