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, What I am doing right now is certain links on my website i am using count.php to save how many clicks it has had to file.
Lets say I have 10 files each with a number of clicks wrote to it.
I've opened these files and put them into variables ("$1" - "$10")
Now I want to sort them into order starting with the most number of clicks to the least (and any of the same number of clicks can just be randomly placed but still in the right place on the list)
I know i've explained that in a really bad way lol but does anyone understand and can help?
I'm not sure I understand what you are talking about
Anyway, I think what you want to do is creating an array with all this "clicks info" and then use rsort()
Ok, almost working, I am using krsort() however when 2 items in the array have the same number "here"=>"" then it just doesnt show them. Is there any way I can stop this happening?
If there any reason you are saving this information to a file and not a database? The database selection of such information could then sort the information for you as well as saving it for statistical purposes at a later date.