i want to strip a url with PHP but i can't figure out how to do it. I thought about explode() but the problem is, what parameter can i use? Because i need to have every single piece of the url to use it later on in the script.
I specificaly need this parts splitted:
- http:// or https://
- www.thewebsite.com/all_the_folowing_parameters
And it also needs to work when www. is missing.
Example:
http://www.thiswebsite.com/thispage.php?this=parameter&thisis_anotherone
Then i thought i could count the characters of the url, but it could also be https, so then my plan failed.
Can anyone give me some advice? It looks that easy, but i just can't figure it out..