Principle: Read the source file for a site, then use the regular analysis of its source code, get all links / ********** qiushuiwuhen (2002-5-20) ******* *** / if (EMPTY ($ URL)) $ URL = "http://www.9cbs.net/expert/"; // Set URL $ Site = Substr ($ URL, 0, STRPOS ($ URL," / ", 8)); // Site $ base = Substr ($ URL, 0, STRPOS ($ URL," / ") 1); // The directory where the file is located
$ fp = fopen ($ URL, "R"); // Open URLWHILE (! Feof ($ FP)) $ Contents. = FREAD ($ FP, 1024); //
$ Pattern = "| href = ['/"]? ([^' / "] ) ['/"] | u "; preg_match_all ($ PATTERN, $ Contents, $ Regarr, preg_set_order); // Match all HREF = for ($ I = 0; $ I