I am trying to load a dom object and to parse it for finding specific links
Here is my code:
$content = file_get_contents(\"http://www.example.com/example.
This is an example from the manual: DOMDocument
loadHTML($content);
// Empty array to hold all links to return
$links = array();
//Loop through each tag in the dom and add it to the link array
foreach($xml->getElementsByTagName('a') as $link) {
$links[] = array('url' => $link->getAttribute('href'), 'text' => $link->nodeValue);
}
print_r($links);
?>