xml - php str_replace() for / and & -


we have created xml feed in magento products different categories. products have name &, or name of brand /. when generate feed, feed gives error. xml error

in previous feeds we've used line of code:

<name><? return str_replace("&", "&amp;", "{name}"); ?></name> 

to turn & &amp; , worked. need same thing /. need turn / 'and' or that.

there 2 (different) lines of codes in our xml feed can paste str_replace:

<? if ("{name}" != "") return "<li><b>name:</b> {name}</li>"; ?> 

and

<name>{name}</name> 

where should str_replace pasted?

i got xml working.

<serie><? return str_replace(array('&', '/') , array('&amp;','and'), "{serie}"); ?></serie>  

did trick me.

the {serie} on end of code problem. don't understand why worked in previous feeds, u don't hear me complaining haha.

thanks.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -