Remove Duplicate Applications from the Mac OSX Open With Menu

My PHP, HTML and CSS files were all registered on my Mac to open with Dreamweaver CS5, and I wanted to change the preferences, so that it would open with Eclipse instead.  I knew how to change the global preference to do it, but noticed that when I right-clicked a PHP file and went to Open With menu, I saw multiple Xcode apps.

Open With menu before
Open With menu before
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\ LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\ -domain system -domain user

Open terminal and paste that chunk of code in and hit enter and here’s what my Open With menu looked like after.

Open With menu after
Open With menu after