Here is my code...
foreach ($relatedStories->getResults() as $story):
$total+=$story->getEstimation();
endforeach;
$$relatedStories is an array of values.im summing the attribute开发者_开发问答 estimation to total. Now i need to access the total value outside. How can i do so????
Define variable $total
outside the loop. ($total = 0;
).
精彩评论