Using PHP I need to check wether an URL I am appending information to already has a parameter or not.
So if the URL is
http://test.com/url?a=1
I would need to add on &b=2, ie
http://test.com/url?a=1&b=2
However if the URL was
http://test.com/url
I would need to append
http://test.com/url?b=2
Is it possible to check for this within PHP? In summary I need to attach the b=2 parameter using the correct separator character ("?" if there was none in the existing link or "&" if there is already a "?" in the existing link).
Thanks!
Greg