URL encoding: Convert &reg; into %AE in php?
<p>I'm scraping a site and pulling in some product content that has special characters such as <code>&amp;reg;</code>
The special characters show up just fine in the browser but they mess up my Omniture tags, specifically the s.products tag. The s.products variable divides its sections by a semi-colon and has a total of 6 sections per product (s.products="Category";"Product name";"Quantity”;”Total Price”;”Incrementor”;”Merchandising”). If the product has<code>&amp;reg;</code> in its name, then an extra semicolon is added to the s.products variable string. This messes everything up and shifts everything in the string to the right, which affects the Quantity and Price.</p>

<p>Is there a way to use URL encoding for the product names so that the <code>&amp;reg;</code> is converted to a <code>%AE</code>? I tried the rawurlencode and htmlspecialchars functions but they didn't work</p>
