<?phprequire_once__DIR__.'/vendor/autoload.php';usePHPHtmlParser\Dom;usePHPHtmlParser\Options;$options=newOptions();$options->setEnforceEncoding('utf8');$url1='https://13dl.me/list/popular/';functionscrape($counter,$options,&$element_a){$titles=array();$next="";foreach($element_aas$line){if(preg_match('/title/',"$line")){$div=$line->find('div');if(preg_match('/div/',"$div")){$titles[]=$div->text;}else{if(preg_match('/Next/',"$line")){$attr='href';$next=$line->$attr;}}}else{;}}unset($element_a);foreach($titlesas$xxxx){$counter++;echo$counter." title :".$xxxx."\n";}unset($titles);returnarray("$next",$counter);}$counter=0;while($url1!=''){if(preg_match('/http/',"$url1")){$dom=newDom();$dom->loadFromUrl($url1,$options);$element_a=$dom->find('a');list($url1,$counter)=scrape($counter,$options,$element_a,$db);unset($element_a);unset($dom);}}die('End');?>