A friend helped us with this line of code a while back, and I'm trying to get it to work for this:
$curPageUrl = "http://www.site.com/index.php?sort=a";
$currentPage = preg_replace("/&sort=\w+/", "", $curPageUrl);
echo $currentPage; // http://www.site.com/index.php?sort=f?sort=a?sort=z
For example, $curPageUrl
gets the clients page they are on and then it passes it through this.
Basically, we want $currentPage
to strip off:
?sort=a
?sort=f
?sort=z
from the $curPageUrl
I hope my example helped.
Thank you.