I have a regex as such
eregi_replace("s=.*&","",$section->urlToThreads);
What it does is replace everything with '' which starts with 's=' and ends with '&'
What I want to do is also if an ‘&’ is not found after the ‘s=’ till the end of the string, then replace everything from ‘s=’ till the end of the string with ”
E.g.
test.php?s=12232dsd23423&t=41 would become test.php?t=41
And
test.php?t=41&s=12232dsd23423 would become test.php?t=41
SOLUTION – WITHOUT REGEX