shamuraq Posted July 17, 2009 Share Posted July 17, 2009 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... Link to comment https://forums.phpfreaks.com/topic/166314-array_rand-for-multidimensional-arrays-please-anyone/ Share on other sites More sharing options...
rhodesa Posted July 17, 2009 Share Posted July 17, 2009 Double post...topic is here: http://www.phpfreaks.com/forums/index.php/topic,260880.0.html Link to comment https://forums.phpfreaks.com/topic/166314-array_rand-for-multidimensional-arrays-please-anyone/#findComment-877067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.