public static function int($value): int
    {
        $cleaned = preg_replace('#[^0-9-+.,]#', '', $value);
        preg_match('#[-+]?[\d]+#', $cleaned, $matches);
        $result = $matches[0] ?? 0;

        return (int)$result;
    }
public static function int($value): int
    {
        $cleaned = preg_replace('#[^0-9-+.,]#', '', $value);
        preg_match('#[-+]?[\d]+#', $cleaned, $matches);
        $result = $matches[0] ?? 0;

        return (int)$result;
    }
public static function int ( $ value ) : int { $ cleaned = preg_replace ( '#[^0-9-+.,]#' , '' , $ value ) ; preg_match ( '#[-+]?[\d]+#' , $ cleaned , $ matches ) ; $ result = $ matches [ 0 ] ?? 0 ; return ( int ) $ result ; }
Smart convert any string to int

@param string $value
@return int
Smart convert any string to int