public static function getCifSum($cif)
    {
        $sum = $cif[2] + $cif[4] + $cif[6];

        for ($i = 1; $i < 8; $i += 2) {
            $tmp = (string) (2 * $cif[$i]);
            $tmp = $tmp[0] + ((strlen($tmp) == 2) ? $tmp[1] : 0);
            $sum += $tmp;
        }

        return $sum;
    }
public static function getCifSum($cif)
    {
        $sum = $cif[2] + $cif[4] + $cif[6];

        for ($i = 1; $i < 8; $i += 2) {
            $tmp = (string) (2 * $cif[$i]);
            $tmp = $tmp[0] + ((strlen($tmp) == 2) ? $tmp[1] : 0);
            $sum += $tmp;
        }

        return $sum;
    }
public static function getCifSum ( $ cif ) { $ sum = $ cif [ 2 ] + $ cif [ 4 ] + $ cif [ 6 ] ; for ( $ i = 1 ; $ i < 8 ; $ i += 2 ) { $ tmp = ( string ) ( 2 * $ cif [ $ i ] ) ; $ tmp = $ tmp [ 0 ] + ( ( strlen ( $ tmp ) == 2 ) ? $ tmp [ 1 ] : 0 ) ; $ sum += $ tmp ; } return $ sum ; }
Used to calculate the sum of the CIF, DNI and NIE.

@param string $cif

@codeCoverageIgnore

@return mixed
Used to calculate the sum of the CIF DNI and NIE .