音乐采集程序
<?php header('Content-Type: text/html; charset=gb2312'); session_start(); set_time_limit(0); $str = file_get_contents('http://music.soso.com/'); preg_match_all('/<a[s]title="([^<]*)">([^<]*)</a></span><a[s]title="([^"]*)">/isU', $str, $out, PREG_SET_ORDER); $iCount = count($out); for ($i = 0; $i < $iCount; $i++) { $str2 = file_get_contents('http://music.soso.com/music.cgi?ty=liss&w=' . urlencode($out[$i][1]) . '&pl=' . urlencode($out[$i][3])); preg_match('/urls[key++][s]=[s]"([^"]*)"/i', $str2, $out2); echo $i + 1 . '、' . $out[$i][3] . ' => ' . $out[$i][1] . ' => ' . $out2[1] . '<br>'; ob_flush(); flush(); }
本文地址:http://www.phprm.com/code/a740c485846f800fb3b67a715692c61b.html
转载随意,但请附上文章地址:-)