My wife and I both got the same issue on our iphone 4s last week.
Very strange -All our other devices continue to connect to the wireless N router - macbooks, ipads etc, but iphones? Nope! Both see the router but can't connect!
We have hard reset, reset all connection settings - everything - no luck. Surely this cant be a coincidence?
Thats what I did as I didnt think it would be the actual wifi and more an issue with the phone.
Turns out that a good old 'turn it off and on again' works!! I switched off the router for 5 minutes, switched it back on and bingo! wifi back on - although no explanation as to why this happened and very annoying!
Very strange but all working again now - so thank you