php - Remove Subdomains from Form Post -


How do I go about removing just the base URL from a base string that was inserted into a form?

Example: User Input: http://stackoverflow.com/question/ask/asdfasneransea Required program only: http://stackoverflow.com What is the easiest way to use / no / code / PHP / PHP?

"text">

You can use just

  $ url = parse_url ('http://example.com/foo/bar'); $ Host = $ url ['Host']; // example.com  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -