1

Topic: Top1?

Hello how would i make a Top1, my little script writes a names to names.txt, an example:
peeter
jaan
haha
jaan
noob
peeter
peeter
Now the top1 would return peeter coz that name is 3 times.. do u get what i mean? i really dont know how do to it sad

Re: Top1?

I don't really understand what you're trying to do...

Re: Top1?

elbekko wrote:

I don't really understand what you're trying to do...

I think he wants to return the most frequently mentioned name from a list in a file called names.txt.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Top1?

http://uk2.php.net/manual/en/function.a … values.php that should help, i'll write an example if you need more help

Re: Top1?

Ah, like that. Yeah, I guess that would do it Connor smile But I don't quite see how you'd select the biggest count from the array :S

Re: Top1?

elbekko wrote:

Ah, like that. Yeah, I guess that would do it Connor smile But I don't quite see how you'd select the biggest count from the array :S

use asort: http://uk2.php.net/manual/en/function.asort.php and then get the get the key for the first/last array item

7

Re: Top1?

thanks guys, i made it, i used key,next,arsort methods.

Re: Top1?

mustbeDreaming wrote:
elbekko wrote:

Ah, like that. Yeah, I guess that would do it Connor smile But I don't quite see how you'd select the biggest count from the array :S

use asort: http://uk2.php.net/manual/en/function.asort.php and then get the get the key for the first/last array item

Oops, n00bie me tongue