<?php $foo = 'http://google.ru/foo/bar/?baz=goo#ololo'; $foo = preg_replace('~^https?://~', '', $foo); $foo = preg_replace('~/*[?#].*$~', '', $foo); var_dump($foo);
You have javascript disabled. You will not be able to edit any code.