[an error occurred while processing this directive] [an error occurred while processing this directive]

Lottozahlengenerator

Dieses Script zeigt anhand der Ermittlung von 6 Lottozahlen, wie ganz einfach mittels eines Arrays zufällige Zahlen generiert werden können.

Live-Onlinedemo: Dieses Script jetzt testen (Neues Fenster)

Der Quellcode:

<?php

mt_srand((double) microtime() * 1000000);
$var = range(1,49);
$rand_var = array_rand($var, 7);

for($x=0;$x<count($rand_var);$x++)
{

$zahl = $var[$rand_var[$x]];

if($x == (count($rand_var)-1)) echo " Zusatzzahl: ";

echo $zahl;

if($x < (count($rand_var)-2)) echo "-";

}


Zurück zum Inhaltsverzeichnis

[an error occurred while processing this directive] [an error occurred while processing this directive]