public function mode($colName)
    {
        $counts = array();
        foreach ($this->rows as $row) {
            $counts[$row[$colName]] = isset($counts[$row[$colName]])?
                $counts[$row[$colName]]+1:1;
        }
        arsort($counts);
        $list = array_keys($counts);
        return $list[0];
    }
public function mode($colName)
    {
        $counts = array();
        foreach ($this->rows as $row) {
            $counts[$row[$colName]] = isset($counts[$row[$colName]])?
                $counts[$row[$colName]]+1:1;
        }
        arsort($counts);
        $list = array_keys($counts);
        return $list[0];
    }
public function mode ( $ colName ) { $ counts = array ( ) ; foreach ( $ this -> rows as $ row ) { $ counts [ $ row [ $ colName ] ] = isset ( $ counts [ $ row [ $ colName ] ] ) ? $ counts [ $ row [ $ colName ] ] + 1 : 1 ; } arsort ( $ counts ) ; $ list = array_keys ( $ counts ) ; return $ list [ 0 ] ; }
Return the mode value of a field

@param string $colName Column name

@return float The mode value of the column
Return the mode value of a field