We just had our wifi go out today on our iPhone 3Gs. It would not detect any network (not just our home network, but no network at all), but it did have a number in the wifi address spot. Our iPod touch and laptops could connect without a problem. I tried many of the tricks that people on this forum (and many other forums) recommended, but nothing worked. As a final all-or-nothing attempt, I did the following without checking for wifi access in between steps, and after all of these steps, it is now working again:
1) Disabled 3G
2) Disabled Data Roaming
3) Reset the iPhone network setting
4) Did a hard reset -> press and hold the home button and the sleep button at the same time until the phone shuts off (ignore the "Shutdown?" screen that shows up during this process... after a few more seconds of button holding it will do a forced shutdown)
5) Reset our home wifi router
6) Waited 3 minutes, then powered back on the phone
7) Re-enabled 3G and Data Roaming
8) Reset the network setting once again
9) Checked for wifi, and all was well again.
So, there you have it! If nothing else has worked for you, it may be worth doing this all-or-nothing approach. I have no idea which step in the process made it work, but since it works now, I don't actually care. If it doesn't work, you've only lost 5 minutes of your time. If it does work, you're phone is awesome again.
Good luck!