How to compare two array values in PHP
问题 i have two functions, the first one is: public function computeGHComponents() { error_reporting (E_ALL^ E_NOTICE); $totals = NULL; foreach ($this->transaction as $t){ $amount = (float) $t['Amount']; if (isset($totals[ $t['SiteID'] ][ $t['TransactionType'] ])){ $totals[ $t['SiteID'] ][ $t['TransactionType'] ] += (float) $amount; } else { $totals[ $t['SiteID'] ][ $t['TransactionType'] ] = (float) $amount; } } foreach($totals as $key => $value) { $this->result[$key]['Deposit'] = isset($value['D'