第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

我的漢字驗證碼,可以輸出,但是漢字顯示是亂碼,以下是我的圖和代碼,我的編碼格式utf-8,utf8,gb2312都試了

http://img1.sycdn.imooc.com//574923370001524807400439.jpg

<?php
????? session_start();

????? $image=imagecreatetruecolor(200, 60);
????? $bgcolor=imagecolorallocate($image, 255, 255, 255);
????? imagefill($image, 0, 0, $bgcolor);
???? ?
????? $fontface='FZYTK.TTF'; //字體一定要命名為英文
?? ? ?
????? $str = "的一是在了不和有大這主中人上為們地個用工時要動國產(chǎn)以
?????????? 走議縣兵固除般引齒千勝細(xì)影濟白格效置推空配刀葉率述今選養(yǎng)德話";

????? //$strdb=array('慕' , '課' ,'網(wǎng)' ,'贊' );
????? $strdb=str_split($str,3);
????? //header('content-type:text/html; charset=gb2312');
????? //var_dump($strdb);
????? //die();
???? $captch_code='';
???? for($i=0;$i<4;$i++)//寫漢字????? ?
???? {
???????? $fontcolor=imagecolorallocate($image,rand(0,120), rand(0,120), rand(0,120));//字體顏色
?????? ?
???????? $index=rand(0,count($strdb));
???????? $cn=$strdb[$index];
???????? $captch_code.=$cn;

???????? imagettftext($image, mt_rand(20,24), mt_rand(-60,60),(40*$i+20), mt_rand(30,35),? $fontcolor, $fontface, $cn);
???????? //imagettftext(image, size, angle, x, y, color, fontfile, text)
?????? }
???? ?

????? $_SESSION['authcode']=$captch_code;

????? for ($i=0; $i < 200; $i++) //干擾點
????? {
???? ??? ?$pointcolor=imagecolorallocate($image, rand(50,200), rand(50,200), rand(50,200));
???? ??? ?imagesetpixel($image, rand(1,199), rand(1,59), $pointcolor);
????? }
???? ?
?????? for ($i=0; $i < 3; $i++) //干擾線
????? {
???? ??? ?$linecolor=imagecolorallocate($image, rand(80,220), rand(80,220), rand(80,220));
???? ??? ?imageline($image, rand(1,199), rand(1,59),rand(1,199), rand(1,59), $linecolor);
????? }

????? header('content-type: image/png; charset=gb2312');
????? imagepng($image);

????? imagedestroy($image);
???? ?
?>

正在回答

5 回答

將 .php文件重新另存為 UTF-8 無BOM 的編碼格式,讓后就行了

0 回復(fù) 有任何疑惑可以回復(fù)我~

UTF-8 檔首無 BOM

0 回復(fù) 有任何疑惑可以回復(fù)我~

解決沒?我也出現(xiàn)了這個問題

0 回復(fù) 有任何疑惑可以回復(fù)我~

改成utf-8 無bom 就不會亂碼了

0 回復(fù) 有任何疑惑可以回復(fù)我~

應(yīng)該是你的驗證那個頁面的編碼格式?jīng)]有設(shè)置,或者設(shè)置的不是和utf-8的

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

我的漢字驗證碼,可以輸出,但是漢字顯示是亂碼,以下是我的圖和代碼,我的編碼格式utf-8,utf8,gb2312都試了

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號