Link to home
Create AccountLog 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
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Nathan Riley

ASKER

Solved on own.