PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ok i am trying to create a simple program that will allow mwe to use an array with 8 numbers, the output form should show the numbers in their original order that the user inputs them, in numerical order, Highest number, lowest number and then the average number. I am confused on what logic i would use to do this. If anyone could help me get started it would be much appreciated. here's waht i have so far.
ok the code you suggested gave me a page full of errors, i dont understand what you are doing. can you explain it, because im not understanding where the array is in your code or what the code is doing
I can't help you with the errors because a.) you haven't said what the errors are, and 2.) you still haven't posted your code beyond that little snippet. I'll explain mine, though, since you asked.
This assigns the value of $_POST['numbers'], which comes from the field(s) named "numbers[]" in your form, to the variable $Numbers. That's it. The rest of the code I posted is yours.
Notice: Undefined index: numbers in C:\wamp\www\Fall2011etoyo\Pro9Output.php on line 7
Warning: array_sum() expects parameter 1 to be array, null given in C:\wamp\www\Fall2011etoyo\Pro9Output.php on line 10
Warning: Division by zero in C:\wamp\www\Fall2011etoyo\Pro9Output.php on line 10
Warning: max() [function.max]: When only one parameter is given, it must be an array in C:\wamp\www\Fall2011etoyo\Pro9Output.php on line 8
Warning: min() [function.min]: When only one parameter is given, it must be an array in C:\wamp\www\Fall2011etoyo\Pro9Output.php on line 9
This is why i asked where is the array in your code?
I thought i had to have an array set up before i can do max -min/ array_sum ...