<?php $array=...; $from=1; $to=1229; for($from;$from<=$to;++$from) {$return+=$array[$from]; }echo $return;
<?php $array=...; $from=1; $to=1229; $arr=array_slice($array,$from,$to-$from+1); echo array_sum($arr);
时间未测试