I have used the following little bit of code to find all links on a page (home.php) and echoed them as URLs. It works fine, but how do I pass the results to a new variable? If I create a new variable:

```
$myvariable ="$element->href";

```

This only echos the last result of many.

```
// Create DOM from URL or file
$html = file_get_html('http://www.somewebsite.xxx/include/home.php');

foreach($html->find('a') as $element)
       echo $element->href . '<br>';

```