  This paper is devoted to study the effects of electromagnetic on the collapse
and expansion of anisotropic gravitating source. For this purpose, we have
evaluated the generating solutions of Einstein-Maxwell field equations with
spherically symmetric anisotropic gravitating source. We found that a single
function generates the various anisotropic solutions. In this case every
generating function involves an arbitrary function of time which can be chosen
to fit several astrophysical time profiles. Two physical phenomenon occur, one
is gravitational collapse and other is the cosmological expanding solution. In
both cases electromagnetic field effects the anisotropy of the model. For
collapse the anisotropy is increased while for expansion it deceases from
maximum value to finite positive value. In case of collaps there exits two
horizons like in case of Reissner-Nordstr$\ddot{o}$m metric.
