I had this happen to mine last weekend. The person on the other end could only hear static with an occasional partial word, but it worked fine on the speaker. I searched google and found a funny sounding solution that fixed my issue, and it has been working fine since. I called my wife's phone and put her's on speaker so I could hear the static. I then blew gently into the mic hole on my phone, when the static stopped the mic was working properly again.
I'm assuming it had a piece of lint or dirt in the mic hole. Hope this helps you out as well.