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

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

為什么的代碼報錯

<?php

header('content-type:text/html;charset=utf-8');

function getVerify($fontFile,$width=500,$height=60)

{

? ? $image= imagecreatetruecolor($width, $height);

? ? $rect_color=imagecolorallocate($image,255,0,0);

? ? imagerectangle($image,0,0,$width,$height,$rect_color);

? ? $rand_color=imagecolorallocate($image,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));

? ? $string=join('',array_merge(range('A','Z'),range('a','z'),range(1,9)));

? ? $len=4;

? ? $textWidth=imagefontwidth(20);

? ? $textHeight=imagefontheight(20);

? ? function getRandColor($image)

? ? {

? ? ? ? return imagecolorallocate($image,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));

? ? }

? ? for($i=0;$i<$len;$i++)

? ? {

? ? ? ? $size= ?mt_rand(20,30);

? ? ? ? $angle= mt_rand(-20,20);

? ? ? ? $x=($width/$len)*$i+$textWidth;

? ? ? ? $y=mt_rand($height/2,$height-$textHeight);

? ? ? ? $fontFile='../font/consola.ttf';

? ? ? ? $rand_color=imagecolorallocate($image,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));

? ? ? ? $code1=str_shuffle($string);

? ? ? ? $code=$code1{0};

? ? ? ? imagettftext($image, $size, $angle,$x,$y,$rand_color,$fontFile,$code);

? ? }

? ? for($i=0;$i<100;$i++)

? ? {

? ? ? ? imagesetpixel($image,mt_rand(0,$width),mt_rand(0,$height),getRandColor($image));

? ? }

? ? for($i=0;$i<5;$i++)

? ? {

? ? ? ? imageline($image,mt_rand(0,$width),mt_rand(0,$height), mt_rand(0,$width),mt_rand(0,$height), getRandColor($image));

? ? }

? ? for($i=0;$i<6;$i++)

? ? {

? ? ? ? imagearc($image, mt_rand(0,$width),mt_rand(0,$height), mt_rand(0,$width/2), mt_rand(0,$height/2), mt_rand(0,360),mt_rand(0,360),getRandColor($image));

? ? }

? ? header('content-type:image/jpeg');

? ? imagejpeg($image);

? ? imagedestroy($image);

}

getVerify();


正在回答

2 回答

有兩個錯誤 第一個在function getVerify($fontFile='./fonts/consola.ttf',$width=500,$height=60) 應該給文字指定默認值 第二個錯誤 imagefilledrectangle() 函數書寫錯誤

0 回復 有任何疑惑可以回復我~

$fontFile的值?

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么的代碼報錯

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號