PHP batch method for obtaining all fixed seed links on the webpage, php Seed
This example describes how PHP batch obtains all fixed seed links on a web page. We will share this with you for your reference. The details are as follows:
When there are many download links, it is like adding all the links to thunder or electric furnace at a time, but it is not in this option. What should I do? We are PHPer. It's hard for us to do this.
Check the code and change it to yours. modify the code according to the actual situation.
<? Phpheader ("content-type: text/html; charset = utf8"); $ str = file_get_contents ('. /ShowFile. asp '); $ str1 =' <a href = "ed2k '; $ str2 ='"> '; $ pos1 = 0; $ pos2 = 0; $ pos3 = 0; $ len = strlen ($ str); $ ed2k = ''; for ($ I = 5000; $ I <$ len;) {$ pos1 = strpos ($ str, $ str1, $ I) + 9; $ pos2 = strpos ($ str, $ str2, $ pos1)-2; $ pos3 = $ pos2-$ pos1; // indicates that the feature connection does not exist and does not stop searching for if ($ pos1 = 9) {break;} $ ed2k = substr ($ str, $ pos1, $ pos3 + 1 ). "\ r \ n"; file_p Ut_contents ('d:/log/a.txt ', $ ed2k, FILE_APPEND); echo substr ($ str, $ pos1, $ pos3 + 1 ). '