Forum Moderators: coopster
For example:
Querystring is?a=12345&b=23456
Querystring is?b=12345&a=23456&c=54321
How could I strip out the value a in both of these scenarios? I assume in the second one I wuold also need to remove the & before value c?
Thanks.
$newstr = preg_replace
(
"/((&a=)¦(\?a=))([a-zA-Z0-9]+)(&)/",
"",
$string
);
There's still one more scenario to replace and thats when it's on the end of the querystring e.g.
?b=1234&c=1234&a=1234567
The above expression always looks for an & on the end of the string so would I have to have a pattern array also looking for:
"/((&a=)¦(\?a=))([a-zA-Z0-9])/"