±¾ÎÄʵÀý½²ÊoÁËPHPÅuÁ¿»ñÈ¡ÍøÒ³ÖÐËuÓй̶¨ÖÖ×ÓÁ´½ÓµÄ½¨¡£*ÖÏi¸ø´o¼Ò¹(C)´o¼Ò²Î¿¼£¬¾ßÌaÈçÏ£º
¾³£µÄÏÂÔØÁ´½Ó±È½Ï¶aµÄʱºo£¬¾ÍÏñÒ»´ÎÐÔ½«ËuÓеÄÁ´½ÓÌi¼Óµ½Ñ¸À×»oÕߵ篣¬µ«ÊÇûÓÐÔÚÕaÖÖÑ¡Ïi£¬Ôoô°i£¬ÔÛÊÇPHPer°¡£¬ÕaʶuÄѲ»µ½ÔÛ
ÇÒ¿´´uÂe£¬µ±È»Òª»»³ÉÄaµÄ£¬Òª¸u¾Ý¾ßÌaÇe¿oÀ´×oÐ޸ġ£
<?php
header("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;
//˵Ã÷ÌØÕ÷Á¬½ÓÒѾ²»´aeÔÚ *ÅÆuÑ°ÕÒ
if($pos1 == 9){break;}
$ed2k = substr($str,$pos1,$pos3+1)."\r\n";
file_put_contents('d:/log/a.txt',$ed2k,FILE_APPEND);
echo substr($str,$pos1,$pos3+1).'<hr/>';
$i = $pos2;
}
?>
¸u¶a¹ØÓÚPHPÏa¹ØÄÚÈݸÐÐËȤµÄ¶ÁÕ߿ɲe¿´±¾Õ¾×¨Ìa£º¡¶php curlÓÃ*¨×ܽa¡¡¢¡¶PHPÊý×e(Array)²Ù×÷¼¼ÇÉ´oÈ«¡¡¢¡¶phpÅÅÐoËa*¨×ܽa¡¡¢¡¶[PHP³£ÓñeÀuËa¨Óe¼¼ÇÉ×ܽa](http://www.jb51.net/Special/242.htm)¡¡¢¡¶[PHPÊý¾Ý½a¹¹ÓeËa¨½Ì³Ì](http://www.jb51.net/Special/614.htm)¡¡¢¡¶[php³ÌÐoÉe¼ÆËa¨×ܽa](http://www.jb51.net/Special/111.htm)¡¡¢¡¶PHPÊýѧÔËËa¼¼ÇÉ×ܽa¡¡¢¡¶phpÕýÔo±i´iʽÓÃ*¨×ܽa¡¡¢¡¶[PHPÔËËaÓeÔËËauÓè×ܽa](http://www.jb51.net/Special/357.htm)¡¡¢¡¶php×Öu´®(string)Óè×ܽa¡¼°¡¶php³£¼uÊý¾Ý¿a²Ù×÷¼¼ÇÉ»a×Ü¡
Ï£Íu±¾ÎÄËuÊo¶Ô´o¼ÒPHP³ÌÐoÉe¼ÆÓÐËu°iÖu¡£