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

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

為什么我的getCaptcha()寫完如果輸出圖像就沒辦法返回$str字符串呢?

?public?function?getCaptcha(){
????????//設(shè)置填充顏色
??????$white=imagecolorallocate($this->_image,255,255,255);
????????//繪制填充矩形
??????imagefilledrectangle($this->_image,?0,?0,?$this->_width,$this->_height,$white);
????????//獲取字符
??????$str=$this->_getStr();
??????if($str?===?false){
??????????return?false;
??????}
????????//繪制驗(yàn)證碼
??????$fontfile=$this->_fontfile;
??????for($i=0;$i<$this->_length;$i++){
??????????$size=$this->_size;
??????????$fonheight=imagefontheight($size);
??????????$angle=mt_rand(-15,15);
??????????$x=20+ceil($this->_width/$this->_length)*$i;
??????????$y=mt_rand($this->_height/2,$this->_height-$fonheight);
??????????$color=$this->_getRoundColor();
??????????//$text=mb_substr($str,$i,1,'utf-8');//從字符集從隨機(jī)獲取一個(gè)字符
??????????$text=$str{$i};
??????????imagettftext($this->_image,?$size,?$angle,?$x,?$y,?$color,?$fontfile,?$text);
??????}
??????//繪制干擾元素?分為雪花模式和像素點(diǎn)線段模式
??????if($this->_snow){
??????????$this->_getSnow();
??????}else{
??????????if($this->_pixel){
??????????????$this->_getPixel();
??????????}
??????????if($this->_line){
??????????????$this->_getLine();
??????????}
??????}
??????//輸出圖像
??????/*向?yàn)g覽器輸出圖像*/
??????header('content-type:image/png');
??????imagepng($this->_image);
??????imagedestory($this->_image);
??????return?strtolower($str);
??}


正在回答

1 回答

因?yàn)?code>header('content-type:image/png');已經(jīng)告訴瀏覽器輸出png圖像


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

舉報(bào)

0/150
提交
取消

為什么我的getCaptcha()寫完如果輸出圖像就沒辦法返回$str字符串呢?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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