Avatar of Nathan Riley
Nathan Riley
Flag 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 "?"
PHPWeb DevelopmentFacebook

Avatar of undefined
Last Comment
Nathan Riley

8/22/2022 - Mon
nap0leon

Turn the URL into an array, splitting it on the ? and use the first piece of the array.
ASKER CERTIFIED SOLUTION
Nathan Riley

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Nathan Riley

ASKER
Solved on own.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck