Escape Semicolon in PHP?
<p>I've created a database where I have product attributes separated with semicolons <code>;</code>. The reason I chose this is it's incredibly unlikely come up naturally as part of one of the specifications.</p>

<p>I was wishing to do this:</p>

<pre><code>&lt;ul&gt;
  &lt;li&gt;&lt;?php str_replace(';','&lt;/li&gt;&lt;li&gt;',$row['specifications']); ?&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>It would have created a nice unordered list. However, the semicolon is seen as part of the PHP code itself rather than part of the <code>str_replace</code> function. It's not being escaped with the normal backslash method.</p>

<p>Is there any way of escaping the semicolon character in this function or have I just been a bit daft in choosing the semicolon and should've chosen something else?!</p>

<p>-- edit --</p>

<p>Sorry, my mistake, it does work. I'd missed my close bracket after ['specifications'].</p>

<p>Thanks for the answers, though!</p>
