Lindsay Going to Court, Begging for Rehab

10/19/2010 5:25 PM PDT

Lindsay Lohan Rehab -- Going to Court, Begging for Rehab

Lindsay Lohan will obey the judge's order -- no small feat -- to be in court this Friday ... and TMZ has learned Sheriff's deputies are ready to take Lindsay back to jail, if necessary.

Law enforcement sources tell us LiLo will indeed leave the Betty Ford Center -- where she's been in treatment since September 27 -- to attend her probation violation hearing for a failed drug test. Judge Elden Fox had ordered Lindsay to be in court, but we know how that's gone in the past.

A source says Lindsay's legal team won't dispute the violation of probation ... but they're hopeful Judge Fox will send Lindsay back to rehab and not to jail because any interruption would severely disrupt her treatment, and she "has come a long way" during her time at Betty Ford. We're told Lindsay is ready and willing to stay in rehab for as long as Judge Fox wishes.

Just in case though -- the L.A. County Sheriff's Department has a plan in place to take her to jail. We're told deputies, both undercover and in uniform, will be in the courthouse with a vehicle warmed up and ready to take Linds to Lynwood Correctional Facility ... where she could be sentenced to a minimum of 30 days.