亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
2. PHP代碼 
Home php教程 PHP源碼 批量下載搜狗詞庫

批量下載搜狗詞庫

May 25, 2016 pm 05:06 PM

批量下載,搜狗詞庫??

<?php
    /*//echo microtime();
    echo $start=strtotime(date("Y-m-01"))."<br/>";
    echo urlencode(iconv("UTF-8","GB2312//IGNORE","中國的") );
    echo urlencode("/");
    require_once "pinyin.php";
    $pinyin=new PY_deal();
    echo join($pinyin->pinyin("麥包包批發(fā),[魅惑/微光搖曳/青春密語]三種款式,自由選擇!現(xiàn)只需50元/款!"));*/
 
    $fp=fopen("dictory.txt", "a+");
    for($i=1;$i<=4;$i++){
        $curl=curl_init();
        $url="http://pinyin.sogou.com/dict/search.php?
        word=%B0%A2%C0%EF%B0%CD%B0%CD%B2%FA%C6%B7%B4%CA%BB%E3&type=0&personal=1&page={$i}";
        $options=array(CURLOPT_URL=>$url,CURLOPT_RETURNTRANSFER=>true,CURLOPT_HEADER=>false);
        curl_setopt_array($curl, $options);
        $rs=curl_exec($curl);
        curl_close($curl);
        $pattern_list="/\<dl\s+class\=\"dictlist\"\>([\S\s]+)?\<\/dl\>/i";
        preg_match_all($pattern_list,$rs,$match);
        $rs=$match[1][0];
        $pattern="/\?id=(\d+?)\"/i";
        preg_match_all($pattern,$rs,$match);
        $rs=$match[1];
         
        foreach($rs as $v){
            $link="http://pinyin.sogou.com/dict/download_txt.php?id={$v}";
            $curl=curl_init();
            $options=array(CURLOPT_URL=>$link,CURLOPT_FILE=>$fp,CURLOPT_HEADER=>false);
            curl_setopt_array($curl, $options);
            curl_exec($curl);
            curl_close($curl);
             
 
        }
 
    }
     
 
    fclose($fp);
?>

2. PHP代碼

$fp=fopen("dictory.txt", "a+");
    for($i=1;$i<=4;$i++){
        $curl=curl_init();
        $url="http://pinyin.sogou.com/dict/search.php?
        word=%B0%A2%C0%EF%B0%CD%B0%CD%B2%FA%C6%B7%B4%CA%BB%E3&type=0&personal=1&page={$i}";
        $options=array(CURLOPT_URL=>$url,CURLOPT_RETURNTRANSFER=>true,CURLOPT_HEADER=>false);
        curl_setopt_array($curl, $options);
        $rs=curl_exec($curl);
        curl_close($curl);
        $pattern_list="/\<dl\s+class\=\"dictlist\"\>([\S\s]+)?\<\/dl\>/i";
        preg_match_all($pattern_list,$rs,$match);
        $rs=$match[1][0];
        $pattern="/\?id=(\d+?)\"/i";
        preg_match_all($pattern,$rs,$match);
        $rs=$match[1];
         
        foreach($rs as $v){
            $link="http://pinyin.sogou.com/dict/download_txt.php?id={$v}";
            $curl=curl_init();
            $options=array(CURLOPT_URL=>$link,CURLOPT_FILE=>$fp,CURLOPT_HEADER=>false);
            curl_setopt_array($curl, $options);
            curl_exec($curl);
            curl_close($curl);
             
 
        }
 
    }
     
 
    fclose($fp);

? ? ? ? ? ?

以上就是批量下載搜狗詞庫的內(nèi)容,更多相關(guān)內(nèi)容請關(guān)注PHP中文網(wǎng)(ipnx.cn)!


? ? ? ?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276