I don't know how I can get the sum
array(1) {
[0]=> array(1) {
["Dato1"]=> string(6) "714084"
}
[1]=> array(1) {
["Dato2"]=> string(6) "600397"
}
}
array(2) {
[0]=> array(1) {
["Dato1"]=> string(6) "714084"
}
[1]=> array(1) {
["Dato2"]=> string(6) "600397"
}
}
The idea is:
sum: 25+125+95 = 245
sum: 32+52+57 = 141
<?php
$sum=0;
$suma =0;
$iterator = new MultipleIterator;
$iterator->attachIterator(new ArrayIterator($datoscaser));
$iterator->attachIterator(new ArrayIterator($datosmapfre));
$iterator->attachIterator(new ArrayIterator($datosbbva));
foreach ($iterator as $values) {
}
?>
I have tried to do this:
foreach ($iterator as $values) {
$suma=$sum+$values;
}
but it tells me that it is an array
1条答案
按热度按时间ha5z0ras1#
you can use :
if you want something more flexible :