Mam taki skrypt:
$wejscie = array ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "w", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",); $pis = $wejscie[$losowe_klucze[0]]. "\n" . $wejscie[$losowe_klucze[1]] . "\n" . $wejscie[$losowe_klucze[2]] . "\n" . $wejscie[$losowe_klucze[3]] . "\n" . $wejscie[$losowe_klucze[4]];
On działa prawidłowe i losuje 5 liczb ,ale jak dodam go do:
<?php // Set the content-type $wejscie = array ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "w", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",); $pis = $wejscie[$losowe_klucze[0]]. "\n" . $wejscie[$losowe_klucze[1]] . "\n" . $wejscie[$losowe_klucze[2]] . "\n" . $wejscie[$losowe_klucze[3]] . "\n" . $wejscie[$losowe_klucze[4]]; // Create the image $im = imagecreatetruecolor(200, 30); // Create some colors $white = imagecolorallocate($im, 255, 127, 80); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw $text = $pis; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, -5, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, -5, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?>
To losuje tylko jedną liczbę.
Czemu
