Php 剥离关联数组中的逗号

Php 剥离关联数组中的逗号,php,arrays,Php,Arrays,我有一个由三个关联数组组成的数组。我试图从价格中去掉逗号: for ($i =1 ; $i<4; $i++) { foreach ($array[$i]['product'] as $products) { str_replace(',', '', $products ['price']); } } for($i=1;$ifor($i=1;$iCool)。您发布的代码以何种方式没有达到您的目的?请阅读。您的字符串操作操作会对数组元素的副本进行操作…我的代码可能有其他问题,因此我需

我有一个由三个关联数组组成的数组。我试图从价格中去掉逗号:

for ($i =1 ; $i<4; $i++) {
foreach ($array[$i]['product'] as $products) {
    str_replace(',', '', $products ['price']);
}
}

for($i=1;$i
for($i=1;$iCool)。您发布的代码以何种方式没有达到您的目的?请阅读。您的字符串操作操作会对数组元素的副本进行操作…我的代码可能有其他问题,因此我需要更仔细地查看。谢谢!
for ($i =1 ; $i<4; $i++) {
  foreach ($array[$i]['product'] as $products) {
    $products ['price'] = str_replace(',', '', $products ['price']);
  }
}
for ($i =1 ; $i<4; $i++) {
  foreach ($array[$i]['product'] as $products) {
    $array [$i]['product']['price'] = str_replace(',', '', $products ['price']);
  }
}