public static function sanitizeLength($input, $maxLen)
    {
        if(isset($input[$maxLen]))     // take string as array of chars
            return substr($input,0,$maxLen);
        else
            return $input;
    }
public static function sanitizeLength($input, $maxLen)
    {
        if(isset($input[$maxLen]))     // take string as array of chars
            return substr($input,0,$maxLen);
        else
            return $input;
    }
public static function sanitizeLength ( $ input , $ maxLen ) { if ( isset ( $ input [ $ maxLen ] ) ) // take string as array of chars return substr ( $ input , 0 , $ maxLen ) ; else return $ input ; }
Shortens the input string to the max length if it is to long.
@param string $input
@param int $maxLen
@return string sanitized string
Shortens the input string to the max length if it is to long .