Get the rest of URL except the domain name

Looking for a code to extract the rest of the URL except the domain name. Here it is:

$path = 'http://winnieverzosa.com/whatever/path/?query=something';
preg_match('/^[^#]*?:\/\/.*?\/(.*)$/', $path, $matches);
echo $mathces[1];
Output:
whatever/path/?query=something