URL Encode equivilant
Posted: Tue Apr 01, 2003 2:58 pm
I am pulling information from a database like
"Bed and Breakfasts" and put it in a link for an a href.
What I am looking for is the string to be encoded like this
Bed%20and%20Breakfasts
but I am not getting that so it ends up with spaces left in.
Again an ex coldfusion guy, we had a command urlencode that would do this.
I thought htmlspecialchars() would do this but it doesn't.
Is there a function I am missing or do I need to do this manually?
Thanks
John
"Bed and Breakfasts" and put it in a link for an a href.
Code: Select all
$link = "default.php?content=category§ion=".htmlspecialchars (stripslashes($rowї"Category"]))."&letter=~";Bed%20and%20Breakfasts
but I am not getting that so it ends up with spaces left in.
Again an ex coldfusion guy, we had a command urlencode that would do this.
I thought htmlspecialchars() would do this but it doesn't.
Is there a function I am missing or do I need to do this manually?
Thanks
John