PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function tagger(){
$rand = rand(1,5);
$int = rand(10,30);
$types = "SISP";
switch($rand){
case 1: $tag = "DINC:$types:PERC:$int"; break;
case 2: $tag = "DSDEC:$types:PERC:$int"; break;
case 3: $tag = "CHAD:$types:PERC:$int"; break;
case 4: $tag = "REFL:$types:PERC:$int"; break;
case 5: $tag = "DSTA:$types:PERC:$int"; break;
}
return $tag;
}
$tag1 = tagger();
$tag2 = tagger();
$tag3 = tagger();
The problem is that I need to make sure that $tag1, $tag2 and $tag3 can't take on the same cases in the switch argument. That is; $tag1, $tag2 and $tag3 should each have a distinct case from the switch function. How would I do this most efficient?