I don't think it's jsut iphones. I have a iPod Touch and it had done the excat same thing. I know that it's heat related, because first time it happened I couldn't get any wifi signal. 2 hours later I turned it on and it worked for 10 secs. Next day I turned it on and it worked for 5 mins then dropped signal again.
Seems like the chips are overheating. I really hope apple does something for the ones that are out of warrently...it's not our fault!