Home  >  Article  >  Backend Development  >  怎么分类统计下面的数组

怎么分类统计下面的数组

WBOY
WBOYOriginal
2016-06-13 12:34:20766browse

如何分类统计下面的数组
$t2=Array
(
    [南昌] => Array
        (
            [优秀] => 1
            [良好] => 1
        )
 
    [赣州] => Array
        (
            [优秀] => 2
        )
 
    [九江] => Array
        (
            [良好] => 1
            [差等] => 1
        )
)

南昌,赣州 九江优秀的数目统计。(根据$t2去计算优良差的个数)
优秀的数组如下
$t2_yx=Array ( 0 => '1', 1 => '2', 2 => '0' );

良好的数组如下
$t2_lh=Array ( 0 => '1', 1 => '0', 2 => '1' );
差等的数组如下
$t2_cd=Array ( 0 => '0', 1 => '0', 2 => '1' );

http://bbs.csdn.net/topics/390628423 
或者看这个。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn