What is the best way in PHP to append a query string to a URL? I don't want to merely paste a query string into a text like just appending it.
No assumptions made.
Suppose the URL already contains
Code:
some_file.php?value=0
Then the next query should be
Code:
some_file.php?value=0&next=something
Suppose the URL doesn't contain I want to append
Code:
somefile.php?next=something
Are they any more conditions that I should check for while appending query strings to URLs?
And should this be done using my own custom function or is there an existing PHP function which appends query strings to URLs cleanly?