Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encoding URLs

Status
Not open for further replies.
This is not a PHP question. With PHP you would just need to output correct code that would validate. W3 standards tell you how to write ampersands on the page and have them validate. Instead of:
Code:
echo '&';
echo '<a href="page.php?var1=1&var2=2">';
do
Code:
echo '&amp;';
echo '<a href="page.php?var1=1&amp;var2=2">';
This will work in all browsers and validate as well.
 
There is a function in PHP called htmlentities() that will convert all characters in a string that have an html entity into that entity. Check the manual.
 
I am getting links from del.icio.us and parsing that RSS document and putting the links on my site. Not all of the links are XHTML valid. I will take a look at the htmlentities() and see if that works for me.

iSeriesCodePoet
iSeries Programmer/Lawson Software Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top