can i ask how to change the current $current_url = urlencode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); echo $current_url; ?>" /> to dollar or to peso
Add Answer
can i ask how to change the current $current_url = urlencode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); echo $current_url; ?>" /> to dollar or to peso
Some Guidance Regarding URI Query PHP Functions urlencode/urldecode, rawurlencode/rawurldecode.
The difference between urlencode and rawurlencode is that
urlencode encodes according to application/x-www-form-urlencoded (space is encoded with +) while
I have re written the Code below
- 1
- 2
- 3
- 4
- 5
- 6
<?php $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].''; $current_url = urlencode($url); echo $current_url; //will output encoded url echo urldecode($current_url); //will output the decoded raw url ?>
Kindly make Changes to rawurlencode If your URL URI has Spaces