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(); 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 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[]. 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. 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); ?> 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
Archived
This topic is now archived and is closed to further replies.