The initial-boundary value problem of a porous medium equation with a variable exponent is considered. Both the diffusion coefficient a x , t and the variable exponent p x , t depend on the time variable t , and this makes the partial boundary value condition not be expressed as the usual Dirichlet boundary value condition. In other words, the partial boundary value condition matching up with the equation is based on a submanifold of ∂ Ω × 0 , T . By this innovation, the stability of weak solutions is proved.