Forum Moderators: coopster

Message Too Old, No Replies

Maximum value of the array

         

Madhu

5:38 am on Aug 30, 2007 (gmt 0)

10+ Year Member



<?php

$i=(10,23,54,76,-90);
$var=array($i);
echo "Maximun value is".max($var);
echo "Minimum value is".min($var);
?>

Habtom

5:45 am on Aug 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something like the following should do it for you:

$i = array(10,23,54,76,-90);
echo "Maximun value is ".max($i);
echo "Minimum value is ".min($i);

Madhu:

You might get a better help if you include:

1. What you are trying to achieve
2. Errors you encountered

Habtom

Madhu

5:56 am on Aug 30, 2007 (gmt 0)

10+ Year Member



thank u habtom it is working now