Ma scusa..non puoi fare semplicemente cosi?

Codice PHP:
<?php

$num_head 
rand(1,4);

$stuff 

"<style type=text/css>

#header a, #header a:link, #header a:active {
display: block;
text-decoration: none;
padding: 0px;
margin: 0px;
width: 765px;
height: 180px;
background: #eee url(http: //www.xxx.com/skins/default/images/header" 
$num_head ".jpg) no-repeat right top;}   

#header a:hover {background-repeat: no-repeat; background-position: right -200px;} 

</style>"
;

echo 
"$stuff";

?>