I'm lost. I'm struggling with random numbers for my lotto.php. The first is going to my HTML:
<textarea name="ticket" rows="20" cols="20"></textarea>
How to take "ticket" to standard php format?
// Set the min/max
$numbers = array_fill(1,47,0);
// array-slice
$numbers = range(1, 47);
shuffle($numbers);
$numbers = array_slice($numbers, 0, 6);
print_r($numbers);
Also, I must have $_POST too.
Make use of implode() of PHP
<?php
$numbers = array_fill(1,47,0);
// array-slice
$numbers = range(1, 47);
shuffle($numbers);
$numbers = array_slice($numbers, 0, 6);
//print_r($numbers);
$lottonum = implode(" ", $numbers); // Space as seperator
echo $lottonum;
OUTPUT :
45 24 6 25 17 28