首頁 後端開發 php教程 php解析html dom節點樹

php解析html dom節點樹

Aug 08, 2016 am 09:32 AM
gt list quot word

不得不感嘆用DOM直接解析HTML DOM樹的彈性與強大,因為基本的HTML元素就是那麼幾種常見的,再加上ID屬性或是CLASS屬性之類的。 。

在解析html檔案時,完全可以用正規中脫離出來,畢竟HTML檔案中存在大量相似的模式,而且程式碼看起來功能比較顯而易見,當然正則是非常強大的,應用的領域也更廣。 。

程式碼如下:

<?php
//关闭载入包含js时的警告提示
error_reporting(E_ERROR | E_PARSE);
class DomTree
{
    //DOM句柄
    private $doc=null;

    //保存基本解释
    private $basic_meaning=array();

    //保存英汉双解
    private $en_or_ch=array();

    //保存英英释义
    private $en_to_en=array();

    //保存例句
    private $example=array();

    //保存常用句型
    private $sentences=array();

    //保存词汇表
    private $glossary=array();

    //保存经典名人名言
    private $auth=array();

    //保存常见错误用法
    private $use_in_wrong = array();

    //保存近义词
    private $approximate_words = array();

    //保存百科解释
    private $baike_trans = array();


    public function __construct($source)
    {
        $this->doc = new DomDocument();

        //判断$source类型
        if(is_file($source))
        {
            file_exists($source)?$this->doc->loadHTMLFile($source):die("文件不存在");
        }
        else if(is_string($source))
        {
           empty($source)?die("传入的字符串不能为空"):$this->doc->loadHTML($source);
        }
        else
        {
            preg_match('#^(http|ftp)://#i', $source)?$this->doc->loadHTML(file_get_contents($source)):die("不支持的资源类型");
        }

        //获取div元素列表
        $div_list = $this->doc->getElementsByTagName("div");
        $div_list_len = $div_list->length;

        for($i=0; $i<$div_list_len; $i++)
        {
            if($div_list->item($i)->hasAttribute("class"))
            {
                switch(trim($div_list->item($i)->getAttribute ("class")))
                {
                    case "basic clearfix":
                        $this->getBasicMeans($div_list->item($i));
                        break;

                    case "layout dual":
                        $this->getEnOrCh($div_list->item($i));
                        break;

                    case "layout en":
                        $this->getEnToEn($div_list->item($i));
                        break;

                    case "layout sort":
                        $this->getExample($div_list->item($i));
                        break;

                    case "layout patt":
                        $this->normalSentence($div_list->item($i));
                        break;

                    case "layout coll":
                        $this->getGlossary($div_list->item($i));
                        break;

                    case "layout auth":
                        $this->getAuth($div_list->item($i));
                        break;

                    case "layout comn":
                        $this->useInWrong($div_list->item($i));
                        break;

                    case "layout nfw":
                        $this->getApproximateWords($div_list->item($i));
                        break;

                    case "layout baike";
                        $this->getBaike($div_list->item($i));
                        break;
                }
            }
        }

    }

    //获取基本解释
    private function getBasicMeans($basic_div)
    {
        $li_list = $basic_div->getElementsByTagName("li");
        $li_list_len = $li_list->length;
        for($i=0; $i<$li_list_len; $i++)
        {
            $item = $li_list->item($i);
            if($item->hasAttribute("style"))
            {
                continue;
            }
            else
            {
                $strong_list  = $item->getElementsByTagName("strong");
                $strong_list_len = $strong_list->length;
                for($j=0; $j<$strong_list_len; $j++)
                {
                    $this->basic_meaning[]=$strong_list->item($j)->nodeValue;
                }
            }
        }
    }

    //获取英汉双解释义
    private function getEnOrCh($div_elem)
    {
        $li_list = $div_elem->getElementsByTagName("li");
        $li_list_len = $li_list->length;
        for($i=0; $i<$li_list_len; $i++)
        {
            $this->en_or_ch[]=$li_list->item($i)->nodeValue;

        }
    }

    //获取英英释义
    private function getEnToEn($div_elem)
    {
        $li_list = $div_elem->getElementsByTagName("li");
        $li_list_len = $li_list->length;
        for($i=0; $i<$li_list_len; $i++)
        {
            $this->en_to_en[]= $this->strip_Empty($li_list->item($i)->nodeValue);
        }
    }
    //格式化操作
    private function strip_Empty($string)
    {
        if(is_string($string))
        {
            return preg_replace('#\s{2,}#', ' ', $string);
        }
    }

    //获取例句
    private function getExample($div_elem)
    {
        if($div_elem->hasChildNodes())
        {
            $ol_list = $div_elem->getElementsByTagName("ol");
            $ol_list_len = $ol_list->length;
            for($i=0; $i<$ol_list_len; $i++)
            {
               $li_list = $ol_list->item($i)->getElementsByTagName("li");
               $li_list_len = $li_list->length;
               for($j=0; $j<$li_list_len; $j++)
               {
                   $this->example[] = $this->strip_Empty($li_list->item($j)->nodeValue);
               }
            }
        }
    }

    //常见句型
    private function normalSentence($div_elem)
    {
        $ol_list = $div_elem->getElementsByTagName("ol");
        $ol_list_len = $ol_list->length;
        for($i=0; $i<$ol_list_len; $i++)
        {
            //获取英语句型
            $li_list = $ol_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $this->sentences[]=$this->strip_Empty($li_list->item($j)->nodeValue);
            }

        }
    }

    //常见词汇
    private function getGlossary($div_elem)
    {
        $ul_list = $div_elem->getElementsByTagName("ul");
        $ul_list_len = $ul_list->length;
        for($i=0; $i<$ul_list_len; $i++)
        {
            //获取常见词汇
            $li_list = $ul_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $this->glossary[]=$this->strip_Empty($li_list->item($j)->nodeValue);
            }

        }
    }

    //获取名人名言
    private function getAuth($div_elem)
    {
        $ul_list = $div_elem->getElementsByTagName("ul");
        $ul_list_len = $ul_list->length;
        for($i=0; $i<$ul_list_len; $i++)
        {
            //获取列表
            $li_list = $ul_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $this->auth[]=$this->strip_Empty($li_list->item($j)->nodeValue);
            }

        }
    }

    //获取常见错误用法
    private function useInWrong($div_elem)
    {
        $ol_list = $div_elem->getElementsByTagName("ol");
        $ol_list_len = $ol_list->length;
        for($i=0; $i<$ol_list_len; $i++)
        {
            //获取错误用法列表
            $li_list = $ol_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $this->use_in_wrong[]=$this->strip_Empty($li_list->item($j)->nodeValue);
            }

        }
    }

    //获取近义词
    private function getApproximateWords($div_elem)
    {
        $ul_list = $div_elem->getElementsByTagName("ul");
        $ul_list_len = $ul_list->length;
        for($i=0; $i<$ul_list_len; $i++)
        {
            $li_list = $ul_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $a_list = $li_list->item($j)->getElementsByTagName("a");
                $a_list_len = $a_list->length;
                for($k=0; $k<$a_list_len; $k++)
                {
                    $this->approximate_words[]=$a_list->item($k)->nodeValue;
                }
            }

        }
    }

    //获取百科解释
    private function getBaike($div_elem)
    {
        $ul_list = $div_elem->getElementsByTagName("ul");
        $ul_list_len = $ul_list->length;
        for($i=0; $i<$ul_list_len; $i++)
        {
            //获取列表
            $li_list = $ul_list->item($i)->getElementsByTagName("li");
            $li_list_len = $li_list->length;
            for($j=0; $j<$li_list_len; $j++)
            {
                $this->baike_trans[]=$li_list->item($j)->nodeValue;
            }

        }
    }

    //接口:  返回基本释义
    public function getBasicMeaning()
    {
        if(!empty($this->basic_meaning))
        {
            return $this->basic_meaning;
        }
    }

    //接口: 返回英汉双解
    public function getEnOrChMeaning()
    {
        if(!empty($this->en_or_ch))
        {
            return $this->en_or_ch;
        }
    }

    //接口:  返回英英释义
    public function getEnToEnMeaning()
    {
        if(!empty($this->en_to_en))
        {
            return $this->en_to_en;
        }
    }

     //接口:  返回例句
    public function getExampleMeaning()
    {
        if(!empty($this->example))
        {
            return $this->example;
        }
    }
    //接口:  返回常用句型
    public function getNormalSentenceMeaning()
    {
        if(!empty($this->sentences))
        {
            return $this->sentences;
        }
    }

    //接口:  返回词汇表
    public function getGlossaryMeaning()
    {
        if(!empty($this->glossary))
        {
            return $this->glossary;
        }
    }

    //接口:  返回名人名言
    public function getAuthMeaning()
    {
        if(!empty($this->auth))
        {
            return $this->auth;
        }
    }

    //接口:  返回常见错误用法
    public function getUseInWrongMeaning()
    {
        if(!empty($this->use_in_wrong))
        {
            return $this->use_in_wrong;
        }
    }

    //接口:  获取近义词
    public function getApproximateWordsMeaning()
    {
        if(!empty($this->approximate_words))
        {
            return $this->approximate_words;
        }
    }

    //接口: 获取百度百科的解释
    public function getBaikeMeaning()
    {
        if(!empty($this->baike_trans))
        {
            return $this->baike_trans;
        }
    }

    //返回所有的翻译
    public function getAllMeaning()
    {
        $all_meaning = array();
        $all_meaning['basic_meaning'] = $this->getBasicMeaning();
        $all_meaning['en_or_ch'] = $this->getEnOrChMeaning();
        $all_meaning['en_to_en'] = $this->getEnToEnMeaning();
        $all_meaning['example']=$this->getExampleMeaning();
        $all_meaning['normal_sentence'] = $this->getNormalSentenceMeaning();
        $all_meaning['glossary_sentence'] = $this->getGlossaryMeaning();
        $all_meaning['auth_sentence'] = $this->getAuthMeaning();
        $all_meaning['wrong_use'] = $this->getUseInWrongMeaning();
        $all_meaning['approximate_words'] = $this->getApproximateWordsMeaning();
        $all_meaning['baike_meaning'] = $this->getBaikeMeaning();
        return $all_meaning;
    }
}

$dom = new DomTree("./com.html");

$trans = $dom->getAllMeaning();
echo "<pre class="brush:php;toolbar:false">";
print_r($trans);
?>
登入後複製

結果如下:

Array
(
    [basic_meaning] => Array
        (
            [0] => 单词;消息;话语;诺言
            [1] => 用词语表达
        )

    [en_or_ch] => Array
        (
            [0] => [C] 字,词 the smallest unit of spoken language which has meaning and can stand alone
            [1] => [C] (说的)话,话语,言语 anything said; remark or statement
            [2] => [S] 消息,信息; 谣言 piece of news; message; rumour
            [3] => [S] 口令,号令; 命令 spoken command or signal
            [4] => [S] 诺言,保证 a promise
            [5] => vt. 用词语表达; 选用 express (sth) in particular words; phrase sth
        )

    [en_to_en] => Array
        (
            [0] => a unit of language that native speakers can identify; "words are the blocks from which sentences are made" "he hardly said ten words all morning" 
            [1] => a brief statement; "he didn't say a word about it" 
            [2] => information about recent and important events; "they awaited news of the outcome" 
            [3] => a verbal command for action; "when I give the word, charge!" 
            [4] => an exchange of views on some topic; "we had a good discussion" "we had a word or two about it" 
            [5] => a promise; "he gave his word" 
            [6] => a word is a string of bits stored in computer memory; "large computers use words up to 64 bits long" 
            [7] => the divine word of God; the second person in the Trinity (incarnate in Jesus) 
            [8] => a secret word or phrase known only to a restricted group; "he forgot the password" 
            [9] => the sacred writings of the Christian religions; "he went to carry the Word to the heathen" 
            [10] => put into words or an expression; "He formulated his concerns to the board of trustees" 
        )

    [example] => Array
        (
            [0] => Could we have a word before you go to the meeting? 你去开会之前,咱们能私下说句话吗?
            [1] => My friend sent word that he was well. 我朋友捎来口信说他很好。
        )

    [normal_sentence] => Array
        (
            [0] =>  What does this word mean? 这个词是什么意思? 
            [1] =>  I couldn't look up the spelling of the word, as I hadn't a dictionary at hand. 我没法查这个词的拼写,因为我手边没有词典。 
            [2] =>  Many English words are derived from Latin. 许多英文单词源于拉丁文。 
            [3] =>  All the words beside the central idea should be crossed out. 凡偏离中心思想的词语都应通通删掉。 
            [4] =>  The editor eliminated slang words from the essay. 编辑将俚语从这篇文章中剔除。 
            [5] =>  These words can't be staled by repetition. 这些词语不会因为经常使用而变成陈词滥调。 
            [6] =>  He gave me his visiting card, with a few words in pencil. 他把他的名片给我,上面有几个铅笔字。 
            [7] =>  I don't believe a word of his story. 他说的这件事我一句话都不相信。 
            [8] =>  At the press conference, the reporters copied down every word spoken by the prime minister. 在新闻发布会上,记者们逐字记下了首相的讲话。 
            [9] =>  Tell me what happened in your words. 用你自己的话把发生的事告诉我。 
            [10] =>  Deeds are better than words when people are in need of help. 当别人需要帮助时,行动胜于语言。 
            [11] =>  I would like a word with you. 我想和你谈谈。 
            [12] =>  After a word with the colonel he went away . 他和上校简单谈过之后就走了。 
            [13] =>  There's been no word from her for weeks. 已经有好几个星期没有她的音信了。 
            [14] =>  Word came that I was needed at home. 有信儿来说家里需要我。 
            [15] =>  Word has come that meeting will be held on Tuesday. 通知已到,星期二开会。 
            [16] =>  Word is that the election will be held in June. 有消息说选举将在六月份举行。 
            [17] =>  Word is that he's left the country. 据说他已经离开这个国家了。 
            [18] =>  Word got round that he had resigned. 谣传他已辞职。 
            [19] =>  Stay hidden until I give the word. 我不下令就藏着别动。 
            [20] =>  Their word is law. 他们的命令必须服从。 
            [21] =>  He gave the word and they let him in. 他说出了口令,他们让他进去了。 
            [22] =>  The word now is “freedom”. 现在的口号是“自由”。 
            [23] =>  I give you my word I'll go. 我向你保证,我会去的。 
            [24] =>  Stand by your word. 要守信用。 
            [25] =>  Hear The Word of God . 听宣讲《圣经》。 
            [26] =>  Be careful how you word your answer. 回答时要斟酌字句。 
            [27] =>  She worded the explanation well. 她的解释措辞得体。 
            [28] =>  The advice wasn't very tactfully worded. 这份通知措辞不太得体。 
            [29] =>  The suggestion might be worded more politely. 那项建议的措辞可以更婉转些。 
            [30] =>  This is a carefully worded contract. 这是一份措辞严谨的合同。 
        )

    [glossary_sentence] => Array
        (
            [0] => address a few words 讲几句话
            [1] => await word from sb 等待某人的消息
            [2] => break one's words 食言
            [3] => breathe a word 走漏消息
            [4] => bring word 带来消息
            [5] => choose a word 选择词
            [6] => coin a word 杜撰一个词
            [7] => cook up words 造新词
            [8] => cross out a word 划掉一个词
            [9] => cut out many words 删掉许多词
            [10] => digest a word 消化一个词
            [11] => doubt sb's words 怀疑某人的话
            [12] => drink in all the words 吸收所有的词语
            [13] => eat one's words 收回前言,认错,道歉
            [14] => exchange angry words 发生口角
            [15] => find words 找出言语(来表达)
            [16] => gain the good word of 博得…的赞扬
            [17] => get word 得到消息
            [18] => get a word 插嘴
            [19] => give one's word 保证,允许
            [20] => give the word 发出命令
            [21] => have words together 争吵
            [22] => have words with sb 与某人吵嘴
            [23] => have a word with sb 同某人谈一谈
            [24] => hunt up a word 查一个词
            [25] => keep one's word 信守诺言
            [26] => leave word 留言
            [27] => leave out a word 省略一个词,丢掉一个词
            [28] => look up a word (在词典里)查一个词
            [29] => memorize words 记单词
            [30] => play on words 玩弄字眼
            [31] => pronounce a word 读一个词
            [32] => put in words for 为…说几句话
            [33] => put the words into sb's mouth 教某人怎么讲
            [34] => quote a word 引用一个词
            [35] => receive word of 收到…消息
            [36] => regret one's words 为说过的话而后悔
            [37] => respect one's word 遵守自己许下的诺言
            [38] => say a word 说句话,进一步,走漏消息
            [39] => say a few words 说几句话
            [40] => say a good word for sb 为某人说好话
            [41] => send sb a word 给某人捎个信儿
            [42] => spell a word 拼写一个词
            [43] => stress the word 重读那个词
            [44] => take back one's word 收回自己的话
            [45] => take sb's word for it 相信了某人的话
            [46] => understand a word 理解某个词的意思
            [47] => use words 用词
            [48] => waste one's words 白费口舌
            [49] => weigh words 斟酌词句
            [50] => write a word 写一个词
            [51] => advance word 事先传出的消息
            [52] => angry words 气话
            [53] => beautiful words 优美的言辞
            [54] => big words 大话
            [55] => borrowed word 外来词
            [56] => broken words 断断续续的话
            [57] => burning words 热情洋溢的话
            [58] => choice words 精选的词句
            [59] => colorful words 丰富的言辞
            [60] => cross words 气话
            [61] => empty words 空洞的话,无意义的话
            [62] => everyday word 日常用语
            [63] => farewell words 送别词
            [64] => fighting words 容易引起争论的话,挑战性的话
            [65] => foreign word 外来词
            [66] => hard words 愤怒的话,激烈的话
            [67] => heated word 激烈的言词,争吵时使用的话
            [68] => high words 愤怒的话,激烈的话
            [69] => hollow words 虚假的言语
            [70] => honeyed words 甜言蜜语
            [71] => hot words 激烈的言词,争吵时使用的话
            [72] => household word 家喻户晓的词
            [73] => irresponsible words 不负责任的话
            [74] => key words 关键的字眼
            [75] => last words 临终遗言
            [76] => living words 现代语
            [77] => meaningful words 意味深长的言语
            [78] => meaningless words 无意义的话
            [79] => misspelled word 拼错的词
            [80] => native word 本国词,本地词
            [81] => pleasant words 动听的语言
            [82] => regional word 方言
            [83] => scientific word 科学用语
            [84] => semi-technical words 半科技词
            [85] => sharp words 愤怒的话,激烈的话
            [86] => simple word 简单的词
            [87] => sincere words 真诚的话
            [88] => small word 小词
            [89] => spoken words 口头语
            [90] => suggestive words 含蓄的话
            [91] => sweet words 甜言蜜语
            [92] => tearful parting words 伤感的离别之言
            [93] => the latest word 最新消息,最后消息
            [94] => uncleanly words 下流话
            [95] => unfamiliar word 生词
            [96] => unusual word 冷僻词
            [97] => warm words 忿怒的话,激烈的话
            [98] => written words 书面语
            [99] => wrong words 错词
            [100] => dictionary word 词典里出现的词
            [101] => English words 英语单词
            [102] => law word 法律用语
            [103] => newspaper word 新闻用语
            [104] => slang word 俚语
            [105] => at a word 立即,立刻
            [106] => in a word 简言之,总之
            [107] => in one's own words 用自己的话说
            [108] => in other words 换言之
            [109] => upon my word 的确,真的
            [110] => without a word 一声没吭
            [111] => word in heavy type 黑体字
            [112] => words in season 时宜的话
            [113] => words of comfort 安慰的话
            [114] => words of command 命令
            [115] => words of complaint 怨言
            [116] => the W- of God 圣经
            [117] => words of praise 表扬的话
            [118] => word of six letters 六个字母的词
            [119] => words of thanks 感谢的话
            [120] => word the explanation 解释
            [121] => word accurately 准确地用言语表达
            [122] => word crudely 简单地用词语〔语言〕表达
            [123] => word felicitously 恰当地用言语表达
            [124] => word intelligibly 清楚地用语言表达
            [125] => word positively 明确地用词语表达
            [126] => word vaguely 含糊地表达
            [127] => word well 措辞得体
        )

    [auth_sentence] => Array
        (
            [0] =>  Rome shall perishswrite that word In the blood that she has spilt. 出自:W. Cowper 
            [1] =>  We have striven..to draw some word from her; but she..answers nothing. 出自:G. P. R. James 
            [2] =>  To use his own words, he was in a cleft stick. 出自:H. Conway 
            [3] =>  Actions speak louder than words. 出自:Proverb 
            [4] =>  He words me, girls, he words me, that I should not Be noble to myself. 出自:Anthony Cleopatra,Shakespeare 
        )

    [wrong_use] => Array
        (
            [0] => 我要跟他说句话。 误 I should like to have word with him. 正 I should like to have a word with him. 
            [1] => 他们听到消息说足球比赛将在今晚电视实况转播。 误 They had a word that the football match would be televised live this evening. 正 They had word that the football match would be televised live this evening. 析 have word是“听到消息〔新闻〕”的意思,“说句话”是have a word。 
            [2] => 对逐词背课文,我感到厌倦。 误 I was tired of reciting the texts word after word. 正 I was tired of reciting the texts word for word. 析 “一字不变地,逐字(背诵或翻译)”是word for word,不是word after word。 
            [3] => 我说了什么错话吗? 误 Have I said any wrong words? 正 Have I said anything wrong? 析 误句语法上没有错,但不符合英语习惯。 
            [4] => 他不遵守诺言。 误 He broke his words. 正 He broke his word. 析 break one's word意为“不遵守诺言”, word在此短语中不用复数形式。 
            [5] => 我刚得知他到达的消息。 误 I have just received the word of his arrival. 正 I have just received word of his arrival. 
            [6] => 有消息传来说我们的篮球队赢了这场比赛。 误 The word came that our basketball team had won the match. 正 Word came that our basketball team had won the match. 析 作“消息”“信息”解时, word前不加冠词。 
            [7] => 他大约是30年前开始当教师的,换句话说,他当教师已经有30年了。 误 He began to work as a teacher some thirty years ago, in another word, he has been a teacher for thirty years. 正 He began to work as a teacher some thirty years ago, in other words, he has been a teacher for thirty years. 析 in other words是固定短语,意为“换句话说”。 
            [8] => 他带信给我说怀特先生不久将动身去美国。 误 He carried me words that Mr.White would soon leave for America. 正 He carried me word that Mr. White would soon leave for America. 析 word作“消息”“信”解时,是不可数名词,其后不可加s。 
            [9] => 今晨我们争吵了。 误 We had a word this morning. 正 We had words this morning. 
            [10] => 他们曾为鸡毛蒜皮的小事同邻居吵过嘴。 误 They had word with their neighbour over some trifles. 正 They had words with their neighbours over some trifles. 析 表示“同某人发生口角”时,用have words with sb, words用复数形式。 
            [11] => 他说的大话使我们都感到惊讶。 误 His big word surprised us all. 正 His big words surprised us all. 
            [12] => 我们绝不收回前言。 误 We should on no account eat our word. 正 We should on no account eat our words. 析 习语big words, eat one's words中, words词尾的s不可省。 
        )

    [approximate_words] => Array
        (
            [0] => account
            [1] => advice
            [2] => chat
            [3] => communication
            [4] => declaration
            [5] => edict
            [6] => expression
            [7] => message
            [8] => notice
            [9] => order
            [10] => password
            [11] => promise
            [12] => remark
            [13] => term
            [14] => couch
            [15] => explain
            [16] => express
            [17] => phrase
            [18] => put
            [19] => say
            [20] => write
        )

    [baike_meaning] => Array
        (
            [0] => word:Microsoft Word,属于办公软件,人们日常生活都有可能接触到他,对他并不陌生。 简介 wordMicrosoft Word是微软公司的一个文字处理器应用程序。它最初是由Richard Bro…
        )

)
登入後複製

以上就介紹了php解析html dom節點樹,包含了面向的內容,希望對PHP教學有興趣的朋友有幫助。

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1321
25
PHP教程
1269
29
C# 教程
1249
24
word自動換行怎麼取消 word自動換行怎麼取消 Mar 19, 2024 pm 10:16 PM

在word文件中進行編輯內容時可能會自動換行,如果這時候不調整的話,對於我們的編輯會帶來很大的影響,讓人十分頭疼,這是怎麼回事呢?其實是標尺的問題,下面小編就介紹word自動換行怎麼取消的解決方法,希望能幫助大家!開啟Word文檔,輸入文字後,嘗試複製並貼上時可能會導致文字跳到新行,這時需調整設定以解決該問題。 2.要解決這個問題,我們首先要知道有這個問題的原因。這時我們點選工具列下的視圖。 3.然後再點選下面的「標尺」選項。 4.這時候我們會發現,文檔的上方出現了一個標尺,標尺上面有幾個錐形標

Word怎麼顯示標尺以及標尺的操作方法詳解! Word怎麼顯示標尺以及標尺的操作方法詳解! Mar 20, 2024 am 10:46 AM

我們在使用Word的時候,為了編輯內容更好美觀,我們常常會使用標尺。要知道,在Word中的標尺包括水平標尺和垂直標尺,用於顯示和調整文件的頁邊距、段落縮排、製表符等。那麼,Word中的標尺怎麼顯示出來的呢?下面,我就來教大家設定標尺的顯示方法。有需要的同學趕快收藏起來吧!步驟如下:1、首先,我們需要把word標尺調出來,預設的word文件是不顯示word標尺的,我們只需要點選word中的【檢視】的按鈕。 2、然後,我們找到【標尺】的選項,勾選就可以了。這樣一來,word標尺就被我們調出來了!是不是

word文檔怎麼加手寫簽名 word文檔怎麼加手寫簽名 Mar 20, 2024 pm 08:56 PM

Word文件由於功能的強大被大家廣泛使用,word裡不但可以插入各種格式,比如圖片和表格等等,現在為了文件的完整性真實性,好多文件都需要在文檔末尾加入手工簽名,聽起來這麼複雜的問題要怎麼解決呢,今天小編就教大家word文檔怎麼加手寫簽名。使用掃描器、相機或手機對手寫簽名進行掃描或拍攝,然後透過PS或其他圖片編輯軟體對圖片進行必要的裁切處理。 2.在要插入手寫簽名的Word文件中選擇“插入—圖片—來自文件”,選擇裁切好的手寫簽名。 3.滑鼠雙擊手寫簽名圖片(或右鍵圖片選擇「設定圖片格式」),彈出「設定圖

如何為Word設定頁邊距 如何為Word設定頁邊距 Mar 19, 2024 pm 10:00 PM

辦公室軟體中Word是我們最常用的軟體之一,我們製作的文字文檔一般都會用Word進行操作,有些文檔按要求還需要提交紙質版,在進行打印之前,一定要把佈局設置好,才能呈現出更好的效果。那麼問題來了,Word設定頁邊距的方法是什麼呢?我們有具體的課程講解為大家解決疑惑。 1.開啟或新建一個word文檔,點選選單列上的「頁面佈局」選單。 2、點選「頁面設定」選項的「頁邊距」按鈕。 3.在清單中選擇常用的頁邊距。 4.如果清單中沒有合適的頁邊距,按一下「自訂邊距」。 5.彈出「頁面設定」對話框,在「頁邊距」選項分別輸

word中底紋設定在哪 word中底紋設定在哪 Mar 20, 2024 am 08:16 AM

我們平常常使用word來辦公,但是你是否知道word中底紋設定在哪呢?今天就來跟大家分享具體的操作步驟,朋友們快來看看吧! 1.首先,開啟word文檔,選取一段需要新增底紋的文字段落訊息,然後點選工具列上的【開始】按鈕,找到段落區域,點選右側的下拉按鈕,(如下圖紅色圈出部分所示)。 2.點選下拉框按鈕之後,在彈出的選單選項中,點選【邊框和底紋】選項,(如下圖紅色圈出部分所示)。 3.在彈出的【邊框和底紋】對話框中,點選【底紋】的這個選項,(如下圖紅色圈出部分所示)。 4.在填滿的那一欄,選擇顏色

Word怎麼繪製表格 Word怎麼繪製表格 Mar 19, 2024 pm 11:50 PM

  word是個很強大的辦公室軟體,相比較wps來說,word細節處理比較有優勢,特別是當文件表述過於複雜,一般使用word會更加省心。所以,當你步入社會以後,一定要學習一些word使用的小技巧。前段時間表弟問我一個這樣的問題,常常看別人使用word時繪製表格呢,感覺挺高大上的。當時我就笑了,看似高大上的內容,其實操作起來只需要3個步驟而已,你知道Word要怎麼繪製表格嗎?  1.開啟word,選取要插入表格的地方,在上方選單列中找到「插入」選項。  2.點選「表格」選項,會出現密密麻麻的小正方體

word虛線怎麼畫 word虛線怎麼畫 Mar 19, 2024 pm 10:25 PM

word是我們辦公室常會用到的軟體,裡邊有很多功能,可以方便我們的操作,例如:大篇文章的話,我們可以使用裡邊的查找功能,知道全文裡邊某個字錯了,可以直接替換不用一個個去更改了;向上級交文檔的時候可以把文檔美化的更好看等等操作,下面小編就來給大家分享word虛線怎麼畫的步驟,大家一起來學習吧! 1.首先,我們打開電腦上的word文檔,如下圖所示:2.然後,在文檔裡邊輸入一串文字,如下圖紅色圈出部分所示:3.接下來,按住【ctrl+A】選取全部文字,如下圖紅色圈出部分所示:4.點選選單列上邊的【開始】

Word向下箭頭刪除的特定操作步驟! Word向下箭頭刪除的特定操作步驟! Mar 19, 2024 pm 08:50 PM

在日常辦公中,如果從網站複製了一段文字,直接貼上到Word中時,常會看到【向下箭頭】,這種【向下箭頭】可以透過選取後刪除,但是如果這種符號特別多,那麼有沒有一個快速刪除所有箭頭的方法呢?那麼今天我就來跟大家分享Word向下箭頭刪除的具體操作步驟!首先,Word中的【向下箭頭】實際上代表【手動換行符】。我們可以用【段落標記】符替換所有的【向下箭頭】,如下圖所示。 2.然後,我們選擇選單列上邊的【尋找和取代】選項,(如下圖紅色圈出部分所示)。 3.然後,點選【替換】指令,會彈出一個彈框,點選【特殊符號】

See all articles