"$link is always going to be set, so the isset($link) is redundant. Perhaps you mean !empty($link)?"
Yup I didn't use the entire function and when I copy pasted it from my editor I changed that for some reason but it is not in the original code. You are exactly right.
"You don't initialize $this_query_string before you start appending to it."
oops I fixed that.
"Why do you use split('.') when you could use explode('.')?"
I never really thought there was a difference until your question so I did a little research and came up some useful info on the difference of split vs explode vs preg_split.
Just goes to show you that doing things the same way just for the sake of doing them the same way isn't always the best way. I had several other functions that I used split to break apart urls and just used it to do the same thing I had always done.
What I didn't know beforehand was split uses regular expressions to match and is slower than preg_split or explode.
"You might be able to shorten some of the parsing with parse_url() and parse_str() functions."
I had looked at the parse_url() function and found a note on relative URLs
Note: This function doesn't work with relative URLs
I had not looked into the parse_str() function but will do so.
Thanks for taking your time to look at my code, your critique has been valuable to me.
Best Regards,
Brandon