Reputation: 5831
I import some URL's from an XML feed.
$myurl = 'http://www.myurl.com?value1=val&value2=val&value3=val
The problem is when I try to validate my code, I need &
instead of &
Upvotes: 0
Views: 79
Reputation: 943537
You need &
when you insert the text into an HTML or XML document, not when it goes anywhere near a database.
If you are generating HTML, then put your text through htmlspecialchars()
to turn it into HTML.
If you are generating XML, then use an XML library to generate it. Don't build it by mashing strings together.
Upvotes: 2