如何从域名字符串中提取单词

For any domain name example for microsoft.com or mainsoft.com how do I divide it into two words?

say mico and soft, main and soft

I am talking about any domains...like stackoverflow.com it should be stack, over, and flow

How can this be done?

I'd suggest searching the domain string against a list of known words, and then using the fine php string library to break it apart.

http://wordlist.sourceforge.net/ is one source of lists of words.

You might want to try one of the hyphenation libraries mentioned in this answer:
Wrapping a text using php, based on language

It splits up words on syllables, which is probably what you want. A dictionary approach would be more reliable I think, but has more dependencies.