public static function split($rut, $vn = null)
    {
        if (!is_null($vn)) {
            return [$rut, $vn];
        }
        $vn = (substr($rut, -1));//Get the last character
        $rut = substr($rut, 0, -1); //Remove tha last char from the rut

        return [$rut, $vn];
    }
public static function split($rut, $vn = null)
    {
        if (!is_null($vn)) {
            return [$rut, $vn];
        }
        $vn = (substr($rut, -1));//Get the last character
        $rut = substr($rut, 0, -1); //Remove tha last char from the rut

        return [$rut, $vn];
    }
public static function split ( $ rut , $ vn = null ) { if ( ! is_null ( $ vn ) ) { return [ $ rut , $ vn ] ; } $ vn = ( substr ( $ rut , - 1 ) ) ; //Get the last character $ rut = substr ( $ rut , 0 , - 1 ) ; //Remove tha last char from the rut return [ $ rut , $ vn ] ; }
Splits the rut into rut and verification number.

Si no le pasas el $vn digito verificador, separa el rut del dígito verificador.
Si le pasas el $vn digito verificador te devuelve ambos parámetros como array.

@param $rut
@param null $vn
@return array [$rut,$vn]
Splits the rut into rut and verification number .