Jump to content

Generate Codes


cyrixware

Recommended Posts

oh men... from DB? weird 

maybe try this first

<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 200, 200, 200);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
$array = range('A','Z');
$array2 = range(0,9);
$newarray = array_merge($array2,$array);
shuffle($newarray);
foreach($newarray as $val){
    ++$x;
    $value .=$val ;
    if($x == 7){
        break;
    }
}
imagestring($im, 5, 20, 5,$value, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>

 

simple but that should work

Link to comment
https://forums.phpfreaks.com/topic/94100-generate-codes/#findComment-482040
Share on other sites

oh men... from DB? weird 

maybe try this first

<?php
// create a 100*30 image
$im = imagecreate(100, 30);
// white background and blue text
$bg = imagecolorallocate($im, 200, 200, 200);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
$array = range('A','Z');
$array2 = range(0,9);
$newarray = array_merge($array2,$array);
shuffle($newarray);
foreach($newarray as $val){
    ++$x;
    $value .=$val ;
    if($x == 7){
        break;
    }
}
imagestring($im, 5, 20, 5,$value, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>

 

simple but that should work

 

Thanks Bro. ;)

Link to comment
https://forums.phpfreaks.com/topic/94100-generate-codes/#findComment-482047
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.