Home > Backend Development > PHP Tutorial > 这个数组是怎样得出“详细”结果

这个数组是怎样得出“详细”结果

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:21:11
Original
923 people have browsed it

请教高手这个数组是怎样得出“详细”结果
$array=array(1,2,3,5,8,13,21,34,55);
$sum=0;
for($i=0;$i{
$sum+=$array[$array[$i]];
}
echo $sum;

------解决方案--------------------
什么意思?

PHP code
$array=array(1,2,3,5,8,13,21,34,55);
$sum=0;
for($i=0;$i';
$sum+=$array[$array[$i]];
}
echo "结果:";
echo $sum; <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
How to create an array within an array?
From 1970-01-01 08:00:00
0
0
0
php array
From 1970-01-01 08:00:00
0
0
0
Array to array
From 1970-01-01 08:00:00
0
0
0
php array rotation
From 1970-01-01 08:00:00
0
0
0
array
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template