我试图改变它,$font_size
但它似乎不起作用。无论如何它都保持不变。即使我将$font_size
最高更改为 130。它保持不变:
<?php
header('Content-type: image/png');
$rand_num = rand(1000, 9999);
$font_size = 130;
$image_width = 110;
$image_height = 20;
$image = imagecreate($image_width, $image_height);
imagecolorallocate($image, 255, 255, 255);
$black_color = imagecolorallocate($image, 0, 0, 0);
imagestring($image, $font_size, 0, 0, $rand_num, $black_color);
for($x=0; $x <= 30; $x++){
$x1 = rand(1, 100);
$y1 = rand(1, 100);
$x2 = rand(1, 100);
$y2 = rand(1, 100);
imageline($image, $x1, $y1, $x2, $y2, $black_color);
}
imagepng($image);
?>