How would I go about extracting just the base URl from a long string that was inputted into a form?
Example:
User inputs: http://stackoverflow.com/question/ask/asdfasneransea
Program needs just: http://stackoverflow.com
and not /question/ask/asdfasneransea
What is the easist way to do this using PHP?