A few things, you are correct that DWMX renders the HTML correctly, and if you want to render the .php code then you need to select the Live Data View option (has a lightening bolt on it). This will properly render the php code assuming you do not have anything on the page that uses a $_POST/$_GET or similar variable, unless you are working on the remote file.
I have found that if you set the site up as a php/mysql server model, it will allow you to acces both the code and design views interchangebly.
Hope this helps.