Reputation: 35
How can i change the URL using PHP, I asked this question before but i didn't receive any answer . so this is my problem i want to add a pagination to my index page ,but in index page i have some icons that's filter some products , so the URL can be like that
so the problem is when i click on next (pagination) the URL instead of this
i get this
so my question is how can i add that parm the URL without removing the existing one using PHP because i tried with JavaScript but i didn't success .
Upvotes: 0
Views: 145
Reputation: 5672
I think you want to use http_build_query
Example:
http_build_query(array_merge($_GET, array('newVariable'=>'someValue')))
Also - possible duplicate of Manipulate a url string by adding GET parameters
Upvotes: 1