We show the H"older continuity of quasiminimizers of the energy functionals
∫f(x,u,∇u)dx with nonstandard growth under the general structure
conditions $$ |z|^{p(x)} - b(x)|y|^{r(x)}-g(x) \leq f(x,y,z) \leq \mu|z|^{p(x)}
- b(x)|y|^{r(x)} + g(x). The result is illustrated by showing that weak
solutions to a class of $(A,B)$-harmonic equations
-{\rm div} A(x,u,\nabla u) = B(x,u,\nabla u), $$ are quasiminimizers of the
variational integral of the above type and, thus, are H"older continuous. Our
results extend works by Chiad`o Piat-Coscia, Fan-Zhao and Giusti-Giaquinta.