I've had an iPhone 3G for a few months, and am on my second phone. First one had a bad 3G antenna--WiFi worked fine, but lousy cellular reception. Apple replaced that one, and the replacement has been working great until today, when it lost all WiFi. Totally. No SSIDs, nada. Downloaded WiFiFoFum to see what it could see, and it saw...nothing.
So, I slapped the back of the iPhone against my palm, about like you'd see a guy knocking the ashes out of a pipe. Not too hard, but hard enough. WiFi started working again immediately.
Given that the slap-the-palm trick worked, and the freezer trick has worked for others, it looks to me like the WiFi problem is (at least in some cases) a hardware problem, having to do with a physical connection inside the iPhone. Maybe it's the WiFi radio, maybe it's the antenna, who knows, but something's not making a good connection in there.