I’ve created a database where I have product attributes separated with semicolons ;. The reason I chose this is it’s incredibly unlikely come up naturally as part of one of the specifications.
I was wishing to do this:
<ul>
<li><?php str_replace(';','</li><li>',$row['specifications']); ?></li>
</ul>
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 str_replace function. It’s not being escaped with the normal backslash method.
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?!
— edit —
Sorry, my mistake, it does work. I’d missed my close bracket after [‘specifications’].
Thanks for the answers, though!
Works fine for me.