I need to remove all occurences of &page=* from a string, where * is a number. How would I do that with regexp(?)
So far I’ve been using,
$this->targetpage = str_replace('&page='.$this->page, '', $_SERVER['REQUEST_URI']);
echo .$this->targetpage;
Also a bonus would be to not have to include the &, as the page=something could also be after the “?”
1 Answer