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?
SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..but heres the code..... that works MOST of the time.
values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a database. the form submits some data to one table, and other data to another table. my problem is that
Sum of Values in an Array
This is probably really simple... but it's been years since I've written anything, so bare with me!I've got a MySQL database setup with a table that has multiple fields, where one is a numerical
Generating unique numbers using php
Hi,I need help in generating unique number using php.I tired using rand() in php.But, by using rand() method,the generated values are repeating.I want unique numbers in my application.Every time in
problem with array - multilingual page
this is my test page :Code: <?php if(isset($_GET['lang'])) { if($_GET['lang'] == "en") { require_once("languages/lang-en.php"); }
What exactly is net neatrality?
What exactly is it? I think it's anti-censorship and... stuff... but I don't really understand it
Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen242/html/staples/event.php on line 46I checked it over and couldn't find anything wrong with an extra
wav to mp3 + goDaddy
I need to convert wav files to mp3s. From what I have found so far one way to do it is to have my PHP script call exec to some mp3 encoder on my host's server. I am using a GoDaddy shared Linux
values in array being escaped
I would like to submit some values - back to the same form for checking before processing...Code: [Select]<FORM method="post"><table width="500px"
how can i make a .gif images for my site
Dear Friends ,Pls solve my problem , I am starting making new site but i dont know how can i make a .gif images for my site . Is there any editor to make my .gif images comfortably