I have some links in a powerpoint presentation, and for some reason, when those links get clicked, it adds a return parameter to the URL. Well, that return parameter is causing my Joomla site's MVC pattern to get bungled.
So, what's an efficient way to strip off this return parameter using PHP...?
Example: http://mydomain.com/index.php?id=115&Itemid=283&return=aHR0cDovL2NvbW11bml0
To remove a querystring from a url, use the split() method to split the string on a question mark and access the array element at index 0 , e.g. url. split('? ')[0] . The split method will return an array containing 2 substrings, where the first element is the url before the querystring.
The safest "correct" method would be:
parse_url()
parse_str()
unset()
them from the arrayhttp_build_query()
Quick and dirty is to use a string search/replace and/or regex to kill off the value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With