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. 
in previous feeds we've used line of code:
<name><? return str_replace("&", "&", "{name}"); ?></name> to turn & & , 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('&','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
Post a Comment