I am appending the values to url in order to pass them to a next page using tag. I want to remove those appended values once I access them on the next page without reloading the page. Is there anyway to do that in php? I want to display the updated url in the browser.
2 Answers
Use parse_url() to split the URL into its components and put the components that you want back together to form the new URL.
If you want to modify the query string, call parse_str() on it, passing an array as second parameter, and modify that array.
2 Comments
user1247412
As per the comments above this will require the reloading the page.
Oswald
Manipulating PHP strings does not require reloading the page. Manipulating the contents of the address bar does, but I see no indication that the OP wants to manipulate the contents of the address bar.
POSTinstead ofGET?