常用数组函数_PHP
时间:2021-07-01 10:21:17
帮助过:15人阅读
常用数组函数
$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");
?>