egysc
04-06-2012, 11:02 PM
how can I implement a php function and an array into a template some thing similar to :<?php
function draw_rand_array($array,$draws)
{
$lastIndex = count($array) - 1;
$returnArr = array();
while($draws > 1)
{
$rndIndex = rand(0,$lastIndex);
array_push($returnArr,array_splice($array,$rndInde x,1));
$draws--;
$lastIndex--;
}
return $returnArr;
}
?>
function draw_rand_array($array,$draws)
{
$lastIndex = count($array) - 1;
$returnArr = array();
while($draws > 1)
{
$rndIndex = rand(0,$lastIndex);
array_push($returnArr,array_splice($array,$rndInde x,1));
$draws--;
$lastIndex--;
}
return $returnArr;
}
?>