亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

為什么檢測驗證碼時,瀏覽器只顯示白色正方形邊框

$width=200;
$height=50;
$image=imagecreatetruecolor($width,$height);
$white=imagecolorallocate($image,255,255,255);

imagefilledrectangle($image,0,0,$width,$height,$white);
$randColor=imagecolorallocate($image,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
$size=mt_rand(20,28);
$angle=mt_rand(-15,15);
$x=50;
$y=30;
$fontFile='fonts/STSONG.TTF';
$text=mt_rand(1000,9999);
imagettftext($image,$size,$angle,$x,$y,$randColor,$fontFile,$text);
header('content-type:image/png');
imagepng($image);
imagedestroy($image);

https://img1.sycdn.imooc.com//5b8f4b9800015e2e18221080.jpg

正在回答

1 回答

童鞋,你這代碼沒啥問題,應該是?

$fontFile='fonts/STSONG.TTF';

這個字體原因,找不到或者路徑不對,導致的。

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

舉報

0/150
提交
取消

為什么檢測驗證碼時,瀏覽器只顯示白色正方形邊框

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

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

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

公眾號

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