I would like to retrieve the original URL from a shortened link before clicking on it and visiting the destination.
I have this external link https://example.com/api.php?redirect=XXXXXXX which redirect to https://new.com . How can I get the original link https://new.com using PHP or Javascript.