PHP reads a link to a site

zhaozj2021-02-16  59

Principle: Read the source file for a site, then use the regular analysis of its source code, get all links

$ 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

转载请注明原文地址:https://www.9cbs.com/read-28069.html

New Post(0)