[Solved] replace “,” with “.” in xml file using php


$xml = simplexml_load_string($s);
// Find all items which name starts with "IndustryCol" 
$items = $xml->xpath('//*[starts-with(name(), "IndustryCol")]');

foreach($items as $k=>$v) {
  // Replace node values 
  $items[$k][0] = str_replace(',', '.', $v);
} 

echo $xml->asXML();

demo

7

solved replace “,” with “.” in xml file using php