so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and then i need to retrieve the keys of the top ten values.
$array1 = array($a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8,$a9,$a10,$a11,$a12,$a13,$a14,$a15,$a16,$a17,$a18,$a19,$a20);
arsort($array1);
<? print_r($array1);?>
which yields
Array ( [4] => 74 [12] => 70 [19] => 70 => 66 [3] => 66 [10] => 63 [2] => 62 [8] => 57 [11] => 57 [15] => 50 [14] => 50 [9] => 50 [1] => 50 [5] => 50 [17] => 30 [7] => 30 [18] => 30 [13] => 23 [16] => 23 [6] => 23 )
i figured how to return the key of the highest value
function max_extract($array1) {
return array_keys($array1, max($array1));
}
$max_key= max($array1);
but i can't figure out how to get the remainder of the top ten keys (i.e. 19,0,3,10,2,8,11,15,14).
any ideas?
Form always sends to error page...
Hello,Any help will be greatly appreciated. I am having trouble getting multiple fields to be required, and with the if multiple errors section. I think that's where the problem is. When I click
remove a ; from emails in textarea
Code: <?php session_start(); $database_host = "localhost"; $database_username = ""; $database_password = ""; $database_name =
onclick problem
I have <input type="text" name="message"><a href=page2.php>click here</a> Can i parse the value whatever written in the textbox on url
Time-based image rotation script
I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the script to show day.jpg from 6 AM to 6 PM, and to show night.jpg from 6 PM to 6 AM.I also need the
form problem
Hi all, I think this is going to be easy to resolve but for I have been looking at it to long and I cannot see my issue!I hope this is in the right section as it uses modalbox, however I think its a
chat
hello i'm amir
What are the two different files you download to update kernel?
What are the two different files you download to update kernel?
PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg" id="doLogin3" value="Login">ON FIREFOX it works finebut on
Time script, set to my time zone?
I am using this line to get the date and timeCode: $time = date(F." ".d.", ".Y." ".g.":".i.":".sa,time());How could I change this to my time zone here
dropdown menu
Hello everbody, I am php newbie. I need to develop a program that once click the drop down menu, the textarea will change the value base on the dropdown menu. I have problem changing the value of