<?php
// 数组操作函数
// 创建数组
$money = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '镹', '拾'];
// 1.打印数组的当前值
echo '当前数组指针的值是:' . current($money);
echo '<hr>';
// 2.打印当前数组的指针值
// print_r(each($money));
// 3.指针下移一位
next($money);
// 打印当前数组指针下的值
echo '当前数组指针的值是:' . current($money);
echo '<hr>';
// 4.指针指向末位
end($money);
echo '当前数组指针的值是:' . current($money);
echo '<hr>';
// 5.指针倒回一位
prev($money);
echo '当前数组指针的值是:' . current($money);
echo '<hr>';
// 6.重置指针(指针指向第一个单元)
reset($money);
echo '当前数组指针的值是:' . current($money);
echo '<hr>';
// 7.遍历数组
echo array($money);
// 数组运算
$a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
// 1.数组求和
echo '当前数组的和是:' . array_sum($a);
echo '<hr>';
// 2.数组求积
echo '当前数组的积是:' . array_product($a);
echo '<hr>';