biquge.php ['dd a','href','',function($content) use($baseUrl){// /0_478/4775388.html - http://www.biquge.tw/bookdata/1/478/4775388.txt $content=str_ireplace('.html', '.txt', $content); $split=explode('_', $content); $split[0]++; $content=im
['dd a','href','',function($content) use($baseUrl){ // /0_478/4775388.html -> http://www.biquge.tw/bookdata/1/478/4775388.txt $content=str_ireplace('.html', '.txt', $content); $split=explode('_', $content); $split[0]++; $content=implode('/', $split); $content=$baseUrl.'bookdata'.$content; return $content; }], 'name' => ['dd a','text'], ])->data; $info= QueryList::Query($html,[ 'title' => ['h1','text'], 'image' => ['#fmimg img','src','',function($content) use($baseUrl){ return $baseUrl.substr($content, 1); }], 'info' => ['#intro','text'], 'author' => ['#info p:eq(0)','text','',function($content){ return preg_replace('/([\w\W]*?):/i', '', $content); }], 'category' => ['.con_top a:eq(1)','text'], 'lastindextime' => ['#info p:eq(2)','text','',function($content){ return preg_replace('/([\w\W]*?):/i', '', $content); }], ])->data; //打印结果 $data=$info[0]; $data['list']=$list; echo json_encode($data);