If you have failed to resolve your landlord tenant problems by properly communicating with your landlord, putting your requests in writing, documenting the condition of the unit, giving the landlord a reasonable amount of time to respond and correct the defect, or if the landlord finds you in breach of lease, either for non-payment of rent or other breach of the lease terms, both you and the landlord can take the matter to court. In the City of Philadelphia landlord tenant matters are brought before the Small Claims Court.
http://courts.phila.gov/pdf/brochures/small-claims-court.pdf