1

Given some arbitrary url:

view.php?viewid=blahblahblah

Is there a way I can encode a query string which has the above URL as a variable and preserves it's (view.php's) query string?

Obviously, for some URL:

obvious.php?obvid=foobarzot&old_url=view.php?viewid=blahblahblah

will not work at all, but is there a php function with which I could encode view.php so that I could pass it around?

Cheers!

PandemoniumSyndicate
  • 2,855
  • 6
  • 29
  • 49

2 Answers2

5

urlencode the URL before adding it to the query string.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
1

I think you're looking for urlencode()

sascha
  • 4,671
  • 3
  • 36
  • 54