I would like to point out that plants do not have an "anaerobic" phase. Plants ALWAYS "breathe" O2. Just the net balance during the day is the production of O2 by photosynthesis because that only occurs under influence of light.
Basically two reactions occur: (Simplified)
reaction one: glucose (C6H12O6) + 6 O2 --> 6 H2O + 6 CO2 (+ heat)
This reaction releases about 2900 kJ/mol (dG ~ -2900 kJ/mol) That energy is used to drive the synthesis of ATP, the "universal energy currency" of all organisms we know of. I will not go further into this as this strays too far off the subject.
reaction two: 6 CO2 + 6 H2O + hv --> glucose (C6H12O6) + 6 O2
In which hv is the energy of a photon of a particular wavelength. I again want to again point out the simplification of this example, as for one glucose is not the only carbohydrate produced and this is just part of a complex system of reactions.
Imagine the cellular respiration (reaction one) occuring at a constant rate, lets say 30 reactions per second (All rate values are arbitrarily chosen). Reaction two is light-dependant so at night the reaction might only occur at a rate of 1 per second due to stray photons. So the net reaction would be 29 times reaction one per second. As the dawn approaches and the plants light exposure increases, so does the rate of reaction two, until it eventually reaches, lets say 100 reactions per second at maximum light exposure. This will mean that at this point the net reaction is 60 reactions per second of reaction two. But the plant still also consumes oxygen (meaning it is NOT anaerobic)! The plant just produces more oxygen in the same time period. If the day and light periods last equally as long the average rate of reaction two would be around 50 reactions per second versus 30 reactions per second of reaction one. This means the overall average reaction rate would be 20 reactions per second. Enabling the plant to store carbohydrates (glucose in this example) and to oxygenate the atmosphere other aerobic organisms require to live.