i am trying to get all external links in one web page and store it in database.
i put all web page contents in variable:

```
$pageContent = file_get_contents("http://sample-site.org");

```

how i can save all external links??

for example if web page has a code such as:

```
<a href="http://othersite.com">other site</a>

```

i want to save <http://othersite.com> in database.
in the other words i want to make a crawler that store all external links exists in one web page.
how i can do this?