doddsey_65 Posted June 9, 2011 Share Posted June 9, 2011 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 More sharing options...
PFMaBiSmAd Posted June 9, 2011 Share Posted June 9, 2011 Take a look at the 'view source' in your browser. Link to comment https://forums.phpfreaks.com/topic/238851-urlencode/#findComment-1227290 Share on other sites More sharing options...
doddsey_65 Posted June 9, 2011 Author Share Posted June 9, 2011 sorry i realised my mistake. When hovering on the link it displays the ? in the path on the bottom of the browser but when clicked it does print the right value in the url. My htaccess file was preventing me from seeing this until now. Link to comment https://forums.phpfreaks.com/topic/238851-urlencode/#findComment-1227291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.