常用数组函数_PHP
程序员文章站
2022-05-06 14:40:37
...
$colors = array("red", "green", "blue","yellow");
print("数组的个数:".count($colors)."
");//数组的个数
print("数组的当前值:".current($colors)."
");//当前的值
end($colors);
print("数组的最后一个的值:".current($colors)."
");
print("
");
$slice = each($colors);//
print("each()函数的使用:"."
");
print($slice[0] . "====" . $slice[1] . "
\n");
print($slice['key'] . "====" . $slice['value'] . "
\n");
?>