title: php str_replace() for / and &
body: <p>We have created an xml feed in Magento for some products from different categories. Some products have a name with a &amp;, or the name of the brand is with a /. When we generate the feed, the feed gives an error.  </p>
  
  <p><img src="https://i.stack.imgur.com/CRjb9.png" alt="xml error"></p>
  
  <p>In previous feeds we've used this line of code:</p>
  
  <pre><code>&lt;name&gt;&lt;? return str_replace("&amp;", "&amp;amp;", "{name}"); ?&gt;&lt;/name&gt;
  </code></pre>
  
  <p>to turn the <code>&amp;</code> into a <code>&amp;amp;</code> and this worked. Now we need to do the same thing with the <code>/</code>. We need to turn the <code>/</code> into 'and' or something like that.</p>
  
  <p>There are 2 (different) lines of codes in our xml feed where we can paste the str_replace:</p>
  
  <pre><code>&lt;? if ("{name}" != "") return "&lt;li&gt;&lt;b&gt;Name:&lt;/b&gt; {name}&lt;/li&gt;"; ?&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;name&gt;{name}&lt;/name&gt;
  </code></pre>
  
  <p>Where should the str_replace be pasted?</p>