I would like to replace the ,
with .
in some Keys like [Price]
for instance.
Given this array:
Array
(
[0] => Array
(
[Product line] => Misc
[Seller] => aaa.com
[Tracking ID] => bbbb
[Date shipped] => October 23, 2015
[Price] => 60,43
[Referral fee rate] => 3,00%
[Quantity] => 2
[Revenue] => 120,86
[Earnings] => 3,62
[Sub Tag] => xxxx
)
[1] => Array
(
[Product line] => Misc
[Seller] => aaaa.com
[Tracking ID] => bbbb
[Date shipped] => October 23, 2015
[Price] => 9,34
[Referral fee rate] => 6,96%
[Quantity] => 1
[Revenue] => 9,34
[Earnings] => 0,65
[Sub Tag] => xxxx
)
)
And the following function:
function str_replace_specific_value($sSearch, $sReplace, &$aSubject){
foreach($aSubject as $sKey => $uknValue) {
if(is_array($uknValue)) {
foreach($sKey as $fKey => $fuknValue) {
$uknValue['Price'] = str_replace($sSearch, $sReplace, $fuknValue);
}
}
}
}
Can someone help me please? I tried a couple of things but can't get it to work.