I have a page with php query results in a table. Now I want to click on a table column name to sort it on that. So what I want to do is reload the page with the same querystring but change one parameter (“&orderby=name”).
The only way I can think of is to get the query with $_SERVER[‘QUERY_STRING’]; and then search and replace the one parameter with regular expressions. And then use that to reload the page by clicking a link.
But there has to be some easier way, right?
You can replace the $_SERVER[‘QUERY_STRING’] and use that as an argument but a more elegant solution would be something like: