str_replace or preg_replace?
Posted: Fri Apr 04, 2008 3:39 pm
Hi guys,
I'm having some troubles here...
I'm checking an URL to see if it contains '&number=1' where '1' is a variable.
(I'm doing this with isset)
and if the URL contains that string with the variable number at the end it should remove the entire string.
I've managed to do this with a constant string with the str_replace() function. But I can't manage to find
a way to remove the bit if it contains a variable number at the end...
Any suggestions?
Thanks in advance!
thiscatis
I'm having some troubles here...
I'm checking an URL to see if it contains '&number=1' where '1' is a variable.
(I'm doing this with isset)
and if the URL contains that string with the variable number at the end it should remove the entire string.
I've managed to do this with a constant string with the str_replace() function. But I can't manage to find
a way to remove the bit if it contains a variable number at the end...
Any suggestions?
Thanks in advance!
thiscatis