Most Counties now offer a Drug Court program, either by itself, or in some situations in conjunction with the ARD Program. Acceptance into Drug Court allows a defendant to avoid jail time. The Drug Court programs are very rigorous and you will have to see a probation officer for a period of time (up to 2 years). You will also be required to appear in Court in front of the Judge and you will have random drug testing. The length of time in the program depends on the charges against you as well as your behavior once you are accepted into the program.
If you fail to meet all of the requirements after you are accepted into Drug Court you can face trial on the original charges and you should not expect the Court to count the time that you spent in the program when you are sentenced.