note 110578 deleted from function.implode by aharvey
| From: | aharvey@php.net | Date: | Fri, 09 Nov 2012 09:25:54 +0000 |
| Subject: | note 110578 deleted from function.implode by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191819@lists.php.net to get a copy of this message | ||
Note Submitter: erilaksmonoadji at gmail dot com
----
an example implode for adding value from the same array index :
function SUM_Arrays($ARRAYS=array()){
$sDB = "";
foreach($ARRAYS as $key=>$VALUE_Arrays){
$hold = implode(",",$VALUE_Arrays);
$sDB .= $hold." ";
}
$arrsRESULTS = array();
$slice_sDB = explode(" ",$sDB);
$n=(count($slice_sDB)-1);
for($xLOOP=0;$xLOOP<$n;$xLOOP++){
$arrsPUSH = explode(",",$slice_sDB[$xLOOP]);
$arrsRESULTS[$arrsPUSH[0]] += $arrsPUSH[1];
}
return $arrsRESULTS;
}