Add up values in an array in an array

I am trying to add up a specific variable (gq_numplayers) and display it. How can I do that if the arrays are in an array?
I am using GameQ ( if you don’t understand what is going on.

var_dump ($results);

// Include the main class file
require '../GameQ.php';

// Define your servers,
// see list.php for all supported games and identifiers.
$servers = array(
        'id' => 'server 1',
        'type' => 'css',
        'host' => '',
        'id' => 'server 2',
        'type' => 'css',
        'host' => '',
        'id' => 'server 3',
        'type' => 'teamspeak3',
        'host' => '',

// Init the class, only need this once
$gq = new GameQ();

//optional settings
$gq->setOption('timeout', 3); // Seconds
$gq->setOption('debug', TRUE);

// You can optionally specify some output filters,
// these will be applied to the results obtained.

// Send requests, and parse the data
$results = $gq->requestData();

//make total
$total = array_sum(?!?!?!??!?!?);

echo $results['server 1']['gq_numplayers'];

Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.