0
我有一個數組montant將單個php數組轉換爲mutilple dim數組?
$montant = array(
"EUR_credit"=>10, "USD_credit"=>20, "EUR_debit"=>30, "JPY_debit"=>20
);
我想
$total = array();
foreach ($montant as $key=>$value){
$check_key = substr($key, 0,3);
if(!isset($check_key)){
}
}
echo '<pre>';
print_r($total);
echo '</pre>';
$total = array('EUR'=>array('credit'=10,'debit'=>30),
'USD'=>array('credit'=20,'debit'=>NULL),
'JPY'=>array('credit'=NULL,'debit'=>20),
)
感謝我的英雄! :) – sophie