partiz
partiz

Reputation: 1216

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

Upvotes: 1

Views: 108

Answers (1)

Iqbal Rizky
Iqbal Rizky

Reputation: 350

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

look for manual php urlencode

Upvotes: 1

Related Questions