JBZoo\Utils\Filter::digits PHP Method

digits() public static method

Return only digits chars
public static digits ( $value ) : mixed
$value
return mixed
    public static function digits($value)
    {
        // we need to remove - and + because they're allowed in the filter
        $cleaned = str_replace(array('-', '+'), '', $value);
        $cleaned = filter_var($cleaned, FILTER_SANITIZE_NUMBER_INT);
        return $cleaned;
    }