To regulate the police of the city and to impose fines, forfeitures and penalties for the violation of any ordinance, and provide for the recovery and collection of the same, and in default of payment to provide for confinement in the city or county prison, or to hard labor upon the streets or elsewhere, for the benefit of the city.
53 P.S. § 23120