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

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

WBOY
WBOYOriginal
2016-06-13 10:35:28888browse

请教高手这个数组是怎样得出“详细”结果
$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>
Statement:
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