This question already has an answer here:
I'm a professional soccer player, living in Turkey currently. I want to visit my girlfriend in Great Britain; she's a British citizen.
Can I get married to her while in the UK on a visit visa?
Of course, I don't plan to live in the UK. I just want marry and then leave immediately. Financially, I'm strong and I'm not dependent. I earn $65,000 yearly.