Rand () within the for

0

I have the following FOR condition:

<? for($i=0; $i<=9; $i++){ ?>
    <input type="button" value="<?=$i?>" name="no" onclick="moveNumbers(this.value)" class="btn btn-default">  
<? } ?>

I would like instead of displaying 0, 1, 2, 3 ... to display randomly. How can I do this?

    
asked by anonymous 18.05.2016 / 14:57

1 answer

-2

In this example you generate numbers between 0 and 100, just change the interval you want in rand(MIN, MAX)

<? for($i=0; $i<=9; $i++){ 
      srand(make_seed());?>
    <input type="button" value="<?=rand(0, 100)?>" name="no" onclick="moveNumbers(this.value)" class="btn btn-default">  
<? } ?>
    
18.05.2016 / 15:59