hello
I have a function called random_draw() stored in functions.tpl.php
random_draw() returns 4 sorted numbers of an array of 16 numbers.
in lucky.php I then include functions.tpl.php and call random_draw()
now I would like to retrieve the array and convert it to a string so I can store it in the table.
can someone help me please? the function seems to work alright by i am not lucky at all extracting the array and converting it to a string.
thanks
here is the function random_draw()
function random_draw()
{
$numbers=array(01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16);
//Get 4 unique random keys from $numbers array.
$rand_keys = array_rand($numbers, 4);
//if you want to sort the random keys
sort($rand_keys);
//print out the random numbers using the
//random keys.
foreach ($rand_keys as $k=>$v) {
return $numbers[$v];
}
}
If the draw is 01324476 (4 joined numbers) I need this string to be inserted in the table. (the 0 in 01, 02, 03 ... is important)
hope someone can help me out 🙂
thanks