  We show the H\"older continuity of quasiminimizers of the energy functionals
$\int f(x,u,\nabla 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.
