⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlgrab5.php

📁 PHP v6.0 For Linux 运行环境:Win9X/ WinME/ WinNT/ Win2K/ WinXP
💻 PHP
字号:
<?php    /*     * urlgrab5.php     *     * A simple command-line utility to extract all of the URLS contained     * within <A HREF> tags from a document.     *     * NOTE: Only works with tidy for PHP 5, please see urlgrab.php for tidy for PHP 4.3.x     *     * By: John Coggeshall <john@php.net>     *     * Usage: php urlgrab5.php <file>     *     */    function dump_nodes(tidyNode $node, &$urls = NULL) {	$urls = (is_array($urls)) ? $urls : array();		if(isset($node->id)) {	    if($node->id == TIDY_TAG_A) {		$urls[] = $node->attribute['href'];	    }	}		    	if($node->hasChildren()) {	    foreach($node->child as $c) {		dump_nodes($c, $urls);	    }	}		return $urls;    }    $a = tidy_parse_file($_SERVER['argv'][1]);    $a->cleanRepair();    print_r(dump_nodes($a->html()));?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -