Jump to content

Array_rand for multidimensional arrays... Please, Anyone?


shamuraq

Recommended Posts

Hi All,

 

I need help with creating random picked numbers from simple multidimensional array...

 

<?
$fraction = array(
			  array("M2",2,4,6,8,10);
			  array("M3",3,6,9,12,15);
			  );

$m_set = array_rand($fraction, count($fraction));
$numerator = array_rand($m_set, count($m_set));
$denominator = array_rand($m_set, count($m_set));
?>

I can't seem to get it working. Is it true that array_rand don't work with multi-dimensional array? If so, how do i go around it?

 

Thanx in advance guys...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.