简体   繁体   中英

issue with urlencode in browsers view (php/html)

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

 <a href="<?php echo 'http://www.example.com/', urlencode('dir'); ?>" 

寻找手册php urlencode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM