Jump to content

urlencode()


doddsey_65

Recommended Posts

when i use urlencode on my links it adds a + where there are spaces but it doesnt turn the special characters into their ASCII equiv.

 

example.

 

This works fine:

 

$link = urlencode('testing this?');
echo $link; // returns testing+this%3F

 

but this doesnt work:

 

$link = urlencode('testing this?');

echo '<a href="'.$link.'">Link</a>'; // returns testing+this?

 

why isnt it converting the special characters when its within a hyperlink?

 

Link to comment
https://forums.phpfreaks.com/topic/238851-urlencode/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.