Hi
No, you can put php where you want, as it doesn't show to the end user. In the end, the php tends to result in html being output, so as long as the html being outputed is in the right place, all is well.
The only caveat is, make sure the php doesn't output anything before the doctype declaration is made, or this can screw up css coding. I often have the php echo posted variables for debugging, and often forget to put them after the doctype, and the page screws up!
If all you want to do is output a php variable inside html or styles, you can do it inline using the '=' operator instead of echo, like this:
<style type=text/css>
body {
margin: <?=$topmargin?>px 0px 0px <?=$leftmargin?>px;
}
</style>
Trevor