loadHTML($html); $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate("/html/body//a"); $net_array=array(); for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i); $url = $href->getAttribute('href'); $net_array[$i] = $url; } return $net_array; } //------------------------------------------------------------------------------- ?>