David Arquette went into rehab soon after partying so hard he busted his nose on the floor while trying to do “the worm” at a trendy LA club.

Before checking into the Betty Ford Clinic over New Year’s weekend, the 39-year-old actor fell flat on his face and bloodied his nose while trying the break-dancing move at Trousdale right after Christmas, Page Six has learned.

Arquette showed up in Miami days later with his face black-and-blue, and refused to take off a Lone Ranger-style mask that barely hid his red, swollen and bruised face.

Still nursing his heartache over his split with his wife, “Cougar Town” star Courteney Cox, Arquette returned to LA for New Year’s Eve and spent late nights at Hollywood strip club Crazy Girls.

A source told us, “David has not handled the split well. He’s been drinking heavily and just went wild. At Trousdale, he got wasted and tried to do the worm, but ended falling on his face and smashing up his nose. There was blood everywhere. And he’s been spending a lot of money at strip clubs. He ended up a total mess.”

Another source told us that Arquette showed up at a year-end party thrown by millionaire Wayne Boich in Miami, where he told fellow guests his face was a mess “from doing ‘the worm.’ ”

He’d earlier appeared at club Liv, wearing a mask that he never removed. Spies said he seemed “wobbly and incoherent” while partying with a group of dwarfs.

Arquette has been struggling over his October separation from Cox, 46. He checked into the Betty Ford Clinic for treatment for alcohol addiction and depression after Cox and other friends begged him to get help.

In a statement, Cox said, “I really admire David and his choice to take charge and better his life. I love and support him.” A rep for Arquette declined to comment.