WHOA!  If you thought Zac Efron's rehab stint was shocking, this will take the cake!

 TMZ  is reporting that Selena Gomez spent two weeks in rehab in AZ last month!  

Sources say Selena went to The Meadows in Arizona for 2 weeks of treatment for a combination of problems, including alcohol, pot and prescription Ambien.

They also told TMZ that her decision was based on "that crazy boy."  Selena blames a lot of her problems on the excesses she was exposed to by being around Bieber and his buddies.

The 2-week program at The Meadows is called DAWN ... specifically designed for people between 18 and 26.  DAWN specializes in substance dependence, trauma, family dynamics, mental health and relapse prevention.

Let's hope she gets the help she needs.  Maybe this is why she's been spending so much time w/ Demi!