0

I have a webpage that has a roster for World of Warcraft on it. I would like to know how do I create summary statistics for number of each Class, number of each Race, and number of each Gender. Can someone please help. The data is read in from an XML page into an array. Thank you.

2 Answers 2

1

I think you can create count array for each of your criteria and loop all your input data. Here is how it can look:

$races_count = array();
foreach ($persons as $person) {
    $races_count[ $person['race'] ] ++;
}

print_r($races_count);
Sign up to request clarification or add additional context in comments.

Comments

0

You can start by using the xml functionality built into php:

http://www.php.net/manual/en/book.xml.php

Then use foreach loops to summarize the data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.