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?
Is it possible to view php source code??
Hi AllI was just wondering if it's possible to view a websites php source code? I know that php is a server side scripting language and that it is processed at the server and the results are sent
How to replace search button with link?
hi to everbody.i have a search submit form and button like this :<form id="f1" name="title" method="post"
Uploading Filetypes and placing them in seperate folders.
Hello, first post , and asking for help im afraid. Very new to PHP, was making good progress I thought , but im stuck with this part. I have a uploading form that works perfectly and uploads
selectbox+database connection retrive problem
Code: [Select] <tr> <th align="left" scope="col"><span class="style2 style8">Features
Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.It'll do the query and then do..$views = $row['views'] + 1;Then insert $views into the database.This updates the view for each refresh of
Port scanner problem
Hai recently i developed one app through which u can check the opened and closed ports under an ip address or domain.but there is a small error.if no port numbers are given then it should scan from
php code to accept and delete incoming data
Using following HTML Code please show me how to write PHP code to accept and delete the incoming data entered through the form below. from the following MySQL database and table.Database = hrmsTable =
Class not found error
I am getting Class 'index' not found in Eval function://write config $path = dirname(__FILE__).DS.'..'.DS.'paymentclass'; if ( $model->payment_class ) { if
Upload file and add HTML
Hey everyone,I have a client has meeting agendas and minutes that should be posted online. I could teach someone how to FTP it onto the site, but I thought PHP would allow for a cooler solution. Here
Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down menu in the php file that is executed afterwards. when I echo frmcounty in the php file it returns