Nathan Riley
asked on
Strip Referral Tag of URL
I'm wanting to strip off any referral tags from Facebook URL.
Example:
https://www.facebook.com/LiquidWebInc?fref=ts
https://www.facebook.com/CocaColaUnitedStates?brand_redir=1
I'd want to strip off ?fref=ts using PHP before inserting into my database. ?fref=ts is not static and could be other text. It appears it's all pre-fixed with a "?"
Example:
https://www.facebook.com/LiquidWebInc?fref=ts
https://www.facebook.com/CocaColaUnitedStates?brand_redir=1
I'd want to strip off ?fref=ts using PHP before inserting into my database. ?fref=ts is not static and could be other text. It appears it's all pre-fixed with a "?"
Turn the URL into an array, splitting it on the ? and use the first piece of the array.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solved on own.