I have to insert this address to MySQL database:

```
http://localhost/user/uploads/files/1/avatar/Dave.jpg

```

I need to separate domain (localhost) and subdomain (if found) from this URL like this:

```
uploads/files/1/avatar/Dave.jpg

```

how do I separate them?