PHP: Updating GET query URL with changed GET variables

I have a page that changes based on different get variables in a URL query (location search). Ex:
myurl?page=1&expand=false
etc.

Is there an easy way to translate properties in the $_GET global to a query string for other links in the document needing to retain those properties initially passed through $_GET?

I built a function that does this for me in the past, but I’m wondering if maybe there was an easier way or a pre-existing built-in function that does the same thing (and I’ve mistakenly made functions php already has in the past :P). Anyone know of something like that?

:nerd: