Im new to PHP, i have seen in many scripts that they have arrays echo'ed out like $something->somethingelse. I thought an array was suposs to be like $something[somethingelse]. any way could someone just tell me what this is
AND
iv got an array with Player names from a game server running Call of duty in it, I want to echo out the first three leaders that have the highest score on that server, this array holds the scores and the names of the players, how do I just narrow is down to the players with the highest score?
Arrays
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
first:
$somthing->somthingelse() is a call to a class function. this is not a array.
$this['that'] is a element of a array and probably not a array itself although it can be a array. $this would be the actual array
second:
read the manual http://www.php.net and read the different sort commands, those will show you how to sort a array by whatever means you need and then you can just echo out the first 3 elements of the array which would be the top 3 players after you sort it properly
$somthing->somthingelse() is a call to a class function. this is not a array.
$this['that'] is a element of a array and probably not a array itself although it can be a array. $this would be the actual array
second:
read the manual http://www.php.net and read the different sort commands, those will show you how to sort a array by whatever means you need and then you can just echo out the first 3 elements of the array which would be the top 3 players after you sort it properly