funnyzocker
Erfahrenes Mitglied
Hallo
Ich habe Folgendes um 1 Zahl zwischen 1 und 7 zu ermitteln
Leider ermittelt er die Zahl nicht
Ich habe Folgendes um 1 Zahl zwischen 1 und 7 zu ermitteln
PHP:
<?php
$von = 1;
$bis = 7;
$anzahl = 1;
function random_nums($von, $bis, $anzahl) {
$tmp1 = array();
$tmp2 = array();
for($x=$von;$x<=$bis;$x++) $tmp1[$x-$von] = $x;
$rand = array_rand($tmp1, $anzahl);
for($x=0;$x<count($rand);$x++) $tmp2[$x] = $tmp1[$rand[$x]];
}
$meine_zahlen = random_nums($von, $bis, $anzahl);
echo"$meine_zahlen";
?>