Regularity for minimizers of functionals with nonstandard growth by A-harmonic approximation