Link to home
Start Free TrialLog in
Avatar of Nathan Riley
Nathan RileyFlag for United States of America

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 "?"
Avatar of nap0leon
nap0leon

Turn the URL into an array, splitting it on the ? and use the first piece of the array.
ASKER CERTIFIED SOLUTION
Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nathan Riley

ASKER

Solved on own.