Within thirty days after the passage of the ordinance or ordinances above recited, said owner or owners shall have the right to petition the court of common pleas of the county in which such city may be situated, setting forth the facts of the case, and the ground of the petitioners' complaint, and thereupon said court after having caused due notice of the presentation of said petition, and of the time fixed for the hearing thereof to be given to the parties in interest, shall proceed to hear and determine said matter of said petition, and shall declare either that said ordinance shall be operative or inoperative, and make such order for the payment of costs, as justice may require.
53 P.S. § 14214