Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/10/2014, 13:54
mensajeescrito
 
Fecha de Ingreso: mayo-2012
Mensajes: 760
Antigüedad: 12 años, 8 meses
Puntos: 5
matriz con valores aleatorios

HOla buenas podrian ayudarme con este problema que tengo:

Tengo una matriz en la cual se muestran los valores pero necesito que muestre los valores de manera aleatoria.

Se que se hace con mt_rand pero no logro que me funcione .

Si pudieran ayudarme les estaria muy agradecido.

Código PHP:
Ver original
  1. $array = array();
  2.        
  3.  
  4.         for ($i=1; $i<=4; $i++) {
  5.                
  6.             for($j=1; $j<=7; $j++) {
  7.  
  8.                 $array[$i][$j] = $i+$j;
  9.                
  10.                 echo $array[$i][$j] . ", ";
  11.  
  12.             }
  13.            
  14.             echo "<br/>";
  15.         }