ok i'm trying to create a top ten list from a database of listed favorite movies.
the following code yields me the correct order and number of votes for each movie
$compare = array_count_values ($anfo);
arsort($compare);
print_r($compare);
Array ( [] => 518 [pulp fiction] => 8 [fight club] => 8 [harry potter] => 7 [zoolander] => 7 [dirty
dancing] => 6 [ notebook] => 6 [mean girls] => 5 [juno] => 5 [300] => 5 [garden state] => 4 [a walk
to remember] => 4 [v for vendetta] => 4 )
I want to code things so that the above list is formated like a top ten list like so...
top movies
1 pulp fiction - 8 votes
2 fight club - 8 votes
3 harry potter - 8 votes
4 zoolander - 7 votes
5 dirty dancing - 6 votes
6 notebook - 6 votes
7 mean girls - 5 votes
8 300 - 5 votes
9 garden state - 4 votes
10 a walk to remember - 4 votes
what do i need to do to make that happen?
i tried
top 10 list
1. <?=$compare[1]?>
2. <?=$compare[2]?>
3. <?=$compare[3]?>
but that didn't work
update.... i just figured out the that i needed to use
$compare2 = array_keys($compare) ;
so that gives me the movie names, now i just need to figure out how to access the count values. any ideas?
Onclick problem in Firefox
Hi, I am using a <label onclick="myfunction(this)"></label>. It doesn't seem to trigger in Firefox but works fine with ie. Does anyone know why?Thanks
Multidimensional array problems in $_POST
I'm having trouble with a three-dimensional $_POST array. It starts as a two-dimensional array on this side:Code: <html> <head>
How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info going to the database gets there securely?
FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,
Email "$"
Hello!!Any PHP guy with a bit of a knowledge in Flash ?When I send a JPEG from flash how to get it to email in PHP.
How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I have been recently assigned a project, in which I have got to extract/download the contents of the
SCRIPT ERROR
Here is the CONTACT FORM I made for our website:<form id="form1" name="form1" method="post" action=""> <table width="528"
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
How a counter of users ? such as ---> (231 Viewing)
I want to count how many users are actually viewing the page, How is that possible?Thank you guys!
Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date which is a java based calendar that displays when using id='datedisplay' in the input form field below.