Skip to content
Advertisement

Create link in PHP with Get Parameters

This page is quite configurable with different parameters. So, it may be called like:

JavaScript

Now my question is, what is the idiom for generating a link to the current page but with one parameter changed?

For example, I’d like to change foo to 5, what’s the easiest way to generate a link like:

JavaScript

I can loop through and do it manually, but I figured there would be some common idiom for this.

Advertisement

Answer

array_merge() is what you’re looking for

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement