I believe the "w" is short hand for "wa" which comes from the japanese hiragana character "ha" (は). The article is pronounced as "wa" to indicate subjects, but in this case, it mimics the sound of someone laughing.

In the internet, they either use that letter, or they just type "w" repeatedly to say it.

I know mostly of emoticons that they use, and they can be pretty intense. My favorite one has to be this one: