Reputation: 1216
I want encode my urls in my webpage...
I use this method:
<a href="<?php echo urlencode('http://www.example.com/dir dir'); ?>"
but in output in browsers the address change to this:
http://www.example.com/http://www.example.com/dir dir
how can I use urlencode to avoid that problem
Upvotes: 1
Views: 108
Reputation: 350
<a href="<?php echo 'http://www.example.com/', urlencode('dir'); ?>"
look for manual php urlencode
Upvotes: 1