I'm trying to convert a XML file to CSV using PHP, but I have a problem with whitespaces for some values inside a tag. This is the XML:
<Product>
<Code>1234</Code>
<Name>product name</Name>
<Category>some category</Category>
<Manufacturer>manufacturer</Manufacturer>
<Price> 100</Price>
<Stock>1</Stock>
</Product>
As you can see, there's a lot of whitespace inside the Price tag, which messes with my CSV formatting. I've tried this but it didn't work:
$Product->Price = preg_replace("/>\s+</", "><", $Product->Price);
Any help will be greatly appreciated. Thanks in advance.