EXCLUSIVE

WWE Hall of Famer Tammy Sytch -- aka Sunny -- just caught a HUUUUGGGE break in her triple DUI case ... avoiding serious jail time thanks to her 97 days in rehab.

Sytch appeared in court in Pennsylvania on Thursday to be sentenced for the three DUI convictions she racked up in 2015.

Each DUI carried a maximum of 90 days in jail -- but Sytch pulled off a miracle in court.

The judge sentenced her to a grand total of 90 days in jail for all 3 DUIs -- but gave her jail credit for the 97 days she spent in a rehab center earlier this year ... so says her attorney Matthew Schnell.

In addition, she got 5 years parole with bi-weekly alcohol testing, 125 hours of community service and will have to pay roughly $2,100 in fines.

We're told the judge also made it clear ... Tammy's in a zero-tolerance situation -- one slip-up and it's the pokey for her.