我有以下数组:
array (
'ID' => 'X485000CF',
'TITLU' => 'xxxxxxxxxxxx,
'APARTAMENTE' => 'Apartament',
'GARS' => NULL,
'VIL' => NULL,
'SPA' => NULL,
'INTRA' => NULL,
'EXTRA' => NULL,
我想将密钥"APARTAMENTE"
的值更改为"Cas/vil"
function timobil($str){
$timobil1= array('APARTAMENTE' => 'Cas/vil');
return strtr($str, $timobil1);
}
使用
将其打印在XML文档中$identification->addChild('property_type', timobil($tip_proprietate));
答案 0 :(得分:1)
$array=array (
'ID' => 'X485000CF',
'TITLU' => 'xxxxxxxxxxxx',
'APARTAMENTE' => 'Apartament',
'GARS' => NULL,
'VIL' => NULL,
'SPA' => NULL,
'INTRA' => NULL,
'EXTRA' => NULL);
$array['APARTAMENTE']='Cas/vil';
print_r($array);
现在将更新新阵列。