Functionals with p(x) growth and regularity