Say I have a URL like somefile.php?sort=id&way=desc .
I want to write a function (or use one already done) that would allow me to add the following variables to the URL and set which I want to delete.
I thought of something like function editGetVar("$add","$leave") , where $add will be an array with new variables to add to the URL, and $leave will be an array with variables that should remain in the URL.
Example:
somefile.php?sort=id&way=desc&buyer=retailer
and I want to remove the โbuyerโ and add the โactionโ, then a href will look like this:
<a href="somefile.php?sort=id&way=desc&action=edit">
I would appreciate any ideas from you.
php global-variables get hyperlink
jwitos
source share