The problem is that when I load page 2 for example the URL becomes:
http://domain.com/index.php?restaurant-id=45¤tpage=2
And that\'s fine but when
You could use http_build_query() for this. It's much cleaner than deleting the old parameter by hand.
It should be possible to pass a merged array consiting of $_GET and your new values, and get a clean URL.
Untested (can't test right now) but should work:
$new_data = array("currentpage" => "mypage.html");
$full_data = array_merge($_GET, $new_data); // New data will overwrite old entry
$url = http_build_query($full_data);