开发者

Help with PHP web page

开发者 https://www.devze.com 2022-12-08 13:06 出处:网络
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 Gende开发者_如

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 Gende开发者_如何学Gor. Can someone please help. The data is read in from an XML page into an array. Thank you.


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);


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消