Please take a look at the exceptional for loop & lt ;? Php/* for ($ I = 0; $ I & lt; 5; $ I ++) {$ rand. = dechex (rand ();} */& nbsp; $ img = imagecreatetruecolor (); & nbsp; $ bg = im abnormal for loop please take a look
/* For ($ I = 0; $ I <5; $ I ++ ){
$ Rand. = dechex (rand (1, 15 ));
}*/
$ Img = imagecreatetruecolor (80, 20 );
$ Bg = imagecolorallocate ($ img, 0, 0 );
$ Te = imagecolorallocate ($ img, 255,255,255 );
Imagestring ($ img, 5, rand (5, 40), 0, "aaa", $ te); // The first one is the font and then X Y
The above for loop was intended to be the 5-digit hexadecimal cycle.
The reason why he needs to be injected is that if he does not notice the image below, it cannot be displayed.
It's strange that I didn't use $ rand either. why not?
In imagestring, I randomly wrote a string "aaa", changed it to $ rand, and the image became small × ....
------ Solution --------------------
This problem also exists on my machine after testing.
Solution: header ("Content-type: image/jpeg"); add ob_clean () to the previous line ();
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service