Help with url string

Hi guys,

How can I convert this variable contained in the url using get:

http://www.domain.com.au/notify.php?id=126&n=Stacking%20&%20Nesting%20Boxes

to

n= Stacking & Nesting Boxes

You mean you want the string to be same in the URL? Did you try urlencode().

Edit:


echo '<a href="date.php?id=126&n=' . urlencode('Stacking & Nesting Boxes') . '">Test</a>';

To convert it back to the original, you want to use urldecode(). However, be careful outputting that into the page because it can open your website to XSS attacks.