<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_14761"> <div class="blockcode"> <div id="code_C6L"><ol> <li> <?php <li> function dump_urls(tidy_node $node, &$urls = NULL) {</li> <li> $urls = (is_array($urls)) ? $urls : array();</li> <li> <li> if(isset($node->id)) {</li> <li> if($node->id == TIDY_TAG_A) {</li> <li> $urls[] = $node->attribute['href'];</li> <li> }</li> <li> }</li> <li> <li> if($node->hasChildren()) {</li> <li> foreach($node->child as $child) {</li> <li> dump_urls($child, $urls);</li> <li> }</li> <li> }</li> <li> return $urls;</li> <li> }</li> <li> <li> $tidy = tidy_parse_file("http://www.php.net/");</li> <li> $urls = dump_urls($tidy->body());</li> <li> print_r($urls);</li> <li>?></li> </ol></div> <em onclick="copycode($('code_C6L'));">复制代码</em> </div> </td></tr></table> <div id="comment_14761" class="cm"> </div> <div id="post_rate_div_14761"></div> <br><br>