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? Quote 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. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/238851-urlencode/#findComment-1227291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.