src/Validate.php
public static function asString($data, $default = null)
    {
        $string = filter_var(
            $data ?? [],
            FILTER_SANITIZE_STRING,
            FILTER_FLAG_NO_ENCODE_QUOTES
        );

        return $string !== false ? $string : $default;
    }
public static function asString($data, $default = null)
    {
        $string = filter_var(
            $data ?? [],
            FILTER_SANITIZE_STRING,
            FILTER_FLAG_NO_ENCODE_QUOTES
        );

        return $string !== false ? $string : $default;
    }
Parameter return as string.

@param mixed $data    → data to convert
@param mixed $default → default value in error case

@return mixed → value, null or customized return value