To file a landlord/tenant eviction, you must pay the court's filing fees. The fees are based on several factors: the number of defendants, amount seeking in damages (i.e. unpaid rent, destruction of property, legal fees), where you are filing (i.e. Bucks County vs. Philadelphia county).
Many leases provide for the landlord to receive legal fees if successful. Unless the lease states this, each party will be responsible for their own legal fees even if they prevail. The legal fees awarded is at the judge's discretion.
Some attorneys charge a flat fee for representation, while others charge per hour. The advantage to a flat rate is that the party knows the fee up-front, whereas the hourly charge could depend on the length of trial and amount of time needed for preparation. Court itself can be as short as 15 minutes to several hours. This is determined on the complexity of the issues and whether the tenants have any defenses.
Finally, if a landlord is successful in obtaining an eviction, they must pay for the sheriff/constable to serve the Order of Possession. This will then enable the sheriff to forcibly remove the tenant if he refuses to leave on his own.