I'm wondering if there is a technique or function to do this or if I'm just going to have to have a ton of IF statements/arrays here-
I have a page called products.php and a few different filters I add in the query string. All the filters (if chosen) could look like this:
products.php?cat=chairs&type=pine&search=Vienna+Range
Is there a simple way to build the query for use again?
I'm going to have buttons/a search box to change the filters I'm using, so will I have to build the URL and query up again for each filter?
For example I'd like to have:
<a href="products.php?cat=tables">Tables</a>
<a href="products.php?cat=beds">Beds</a>
<a href="products.php?cat=chairs">Chairs</a>
but also build the query so that it remembers my search term, wood type and range; so clicking on "Tables" would take me to
products.php?cat=chairs&type=pine&search=Vienna+Range.
http_build_query? php.net/http_build_query