sandy1028 Posted September 21, 2007 Share Posted September 21, 2007 $myArray = array(); while($row = mysql_fetch_assoc($result)) { $myArray[] = $row['fielsname']; } How to find the max and count in myArray(); Quote Link to comment https://forums.phpfreaks.com/topic/70138-max-value-and-count-of/ Share on other sites More sharing options...
Barand Posted September 21, 2007 Share Posted September 21, 2007 www.php.net/max www.php.net/count Quote Link to comment https://forums.phpfreaks.com/topic/70138-max-value-and-count-of/#findComment-352253 Share on other sites More sharing options...
sandy1028 Posted September 21, 2007 Author Share Posted September 21, 2007 Hi, I want to find the max value in the myArray[]. Quote Link to comment https://forums.phpfreaks.com/topic/70138-max-value-and-count-of/#findComment-352268 Share on other sites More sharing options...
sandy1028 Posted September 21, 2007 Author Share Posted September 21, 2007 When i print $graphValues i get output as Array How to find maximum value from it. Quote Link to comment https://forums.phpfreaks.com/topic/70138-max-value-and-count-of/#findComment-352304 Share on other sites More sharing options...
jitesh Posted September 21, 2007 Share Posted September 21, 2007 <?php echo " Maximum Value ".max($myArray); echo "<br>"; echo " Total vlaues ".count($myArray); // OR echo " Total vlaues ".sizeof($myArray); ?> Quote Link to comment https://forums.phpfreaks.com/topic/70138-max-value-and-count-of/#findComment-352307 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.