42 Pa.C.S. § 9725
The court shall impose a sentence of total confinement if, having regard to the nature and circumstances of the crime and the history, character, and condition of the defendant, it is of the opinion that the total confinement of the defendant is necessary because:
Cross References. Section 9725 is referred to in sections 9721, 9724, 9802 of this title.