最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

我的漢字驗(yàn)證碼,可以輸出,但是漢字顯示是亂碼,以下是我的圖和代碼,我的編碼格式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 = "的一是在了不和有大這主中人上為們地個(gè)用工時(shí)要?jiǎng)訃a(chǎn)以
?????????? 走議縣兵固除般引齒千勝細(xì)影濟(jì)白格效置推空配刀葉率述今選養(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++) //干擾點(diǎn)
????? {
???? ??? ?$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)了這個(gè)問題

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

改成utf-8 無bom 就不會(huì)亂碼了

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

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

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

舉報(bào)

0/150
提交
取消

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

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

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

幫助反饋 APP下載

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

公眾號(hào)

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