It shall be the duty of the keeper of the city jail, watch, and station houses to provide all persons confined therein for any offense with necessary food during their confinement, and the cost thereof, not exceeding thirty cents (30¢) per day to each person, shall be taxed as costs in the case and paid to the keeper of the jail, watch, or station house out of the city treasury, on the certificate of the chief of police and approval of the mayor, when audited by the city council.