<legend id='83E9K'><style id='83E9K'><dir id='83E9K'><q id='83E9K'></q></dir></style></legend>

  1. <tfoot id='83E9K'></tfoot>

      • <bdo id='83E9K'></bdo><ul id='83E9K'></ul>

      <small id='83E9K'></small><noframes id='83E9K'>

      <i id='83E9K'><tr id='83E9K'><dt id='83E9K'><q id='83E9K'><span id='83E9K'><b id='83E9K'><form id='83E9K'><ins id='83E9K'></ins><ul id='83E9K'></ul><sub id='83E9K'></sub></form><legend id='83E9K'></legend><bdo id='83E9K'><pre id='83E9K'><center id='83E9K'></center></pre></bdo></b><th id='83E9K'></th></span></q></dt></tr></i><div id='83E9K'><tfoot id='83E9K'></tfoot><dl id='83E9K'><fieldset id='83E9K'></fieldset></dl></div>
    1. PHP实现DeepL翻译API调用

      DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
    2. <legend id='K7msM'><style id='K7msM'><dir id='K7msM'><q id='K7msM'></q></dir></style></legend>
          <tbody id='K7msM'></tbody>

        1. <small id='K7msM'></small><noframes id='K7msM'>

            <i id='K7msM'><tr id='K7msM'><dt id='K7msM'><q id='K7msM'><span id='K7msM'><b id='K7msM'><form id='K7msM'><ins id='K7msM'></ins><ul id='K7msM'></ul><sub id='K7msM'></sub></form><legend id='K7msM'></legend><bdo id='K7msM'><pre id='K7msM'><center id='K7msM'></center></pre></bdo></b><th id='K7msM'></th></span></q></dt></tr></i><div id='K7msM'><tfoot id='K7msM'></tfoot><dl id='K7msM'><fieldset id='K7msM'></fieldset></dl></div>

              <bdo id='K7msM'></bdo><ul id='K7msM'></ul>
            • <tfoot id='K7msM'></tfoot>

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。
                在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以买到DeepL的Pro账号。
                function DeepL($value,$auth_key,$target){
                	
                    $ch = curl_init();
                    curl_setopt($ch, CURLOPT_URL, 'https://api.deepl.com/v1/translate');
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS,         
                    "auth_key=".$auth_key."&text=".$value."&target_lang=".$target);
                 
                    //这玩意很蛋疼,一定要把HTTPS检测关了。不然无法运行的
                    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
                    //这玩意很蛋疼,一定要把HTTPS检测关了。不然无法运行的
                 
                    $headers = array();
                    $headers[] = 'Content-Type: application/x-www-form-urlencoded';
                    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                 
                    $result = curl_exec($ch);
                    if (curl_errno($ch)) {
                        echo 'Error:' . curl_error($ch);
                    }
                    curl_close($ch);
                 
                    $translatedWords = json_decode($result, true); // Decode the word
                    $result = $translatedWords['translations'][0]['text']; // Search the word
                 
                    return $result;
                }
                $vale = '需要翻译的文本';
                $auth_key = ''; //这个是自己要有DeepLPro账号才能生成,直接后台那个key就是,贴进来就行
                echo DeepL($value,$auth_key,"EN");
                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                smtp gmail server php mailer not working(smtp gmail服务器php邮件程序不工作)

                <small id='fv2vD'></small><noframes id='fv2vD'>

                    • <bdo id='fv2vD'></bdo><ul id='fv2vD'></ul>
                          <tbody id='fv2vD'></tbody>
                        <i id='fv2vD'><tr id='fv2vD'><dt id='fv2vD'><q id='fv2vD'><span id='fv2vD'><b id='fv2vD'><form id='fv2vD'><ins id='fv2vD'></ins><ul id='fv2vD'></ul><sub id='fv2vD'></sub></form><legend id='fv2vD'></legend><bdo id='fv2vD'><pre id='fv2vD'><center id='fv2vD'></center></pre></bdo></b><th id='fv2vD'></th></span></q></dt></tr></i><div id='fv2vD'><tfoot id='fv2vD'></tfoot><dl id='fv2vD'><fieldset id='fv2vD'></fieldset></dl></div>

                        <tfoot id='fv2vD'></tfoot>
                        <legend id='fv2vD'><style id='fv2vD'><dir id='fv2vD'><q id='fv2vD'></q></dir></style></legend>