The example in this article describes how to obtain all the fixed-seed links in a Web page in PHP. Share to everyone for your reference, specific as follows:
Frequent download links are more often, just like all the links added to the Thunderbolt or electric stove, but not in this option, how to do, we are phper ah, this thing is not difficult to us
And look at the code, of course, to replace you, according to the specific circumstances to make changes.
<?php
Header ("Content-type:text/html;charset=utf8");
$str = file_get_contents ('./showfile.asp ');
$str 1 = ' <a href= ' ed2k ';
$str 2 = ' > ';
$pos 1 = 0;
$pos 2 = 0;
$pos 3 = 0;
$len = strlen ($STR);
$ed 2k = ';
for ($i =5000; $i < $len;) {
$pos 1 = strpos ($str, $str 1, $i) + 9;
$pos 2 = Strpos ($str, $str 2, $pos 1)-2;
$pos 3 = $pos 2-$pos 1;
Indicates that the feature connection no longer exists discard look for
if ($pos 1 = = 9) {break;}
$ed 2k = substr ($str, $pos 1, $pos 3+1). " \ r \ n ";
File_put_contents (' D:/log/a.txt ', $ed 2k,file_append);
Echo substr ($str, $pos 1, $pos 3+1). '
More about PHP Interested readers can view the site topics: "Php Curl Usage Summary", "PHP array" operation Skills Daquan, "PHP Sorting algorithm Summary", "PHP common traversal algorithm and skills summary", "PHP Data structure and algorithm tutorial", " PHP Programming algorithm Summary, "PHP Mathematical Calculation Skills Summary", "PHP Regular Expression Usage summary", "PHP operation and operator Usage Summary", "PHP string (String) Usage summary" and "PHP common database Operation skill Summary"
I hope this article will help you with the PHP program design.