Non ho capito, hai una variabile js e vorresti scriverla in una php?

Se sì prova così:

Codice PHP:
<script type="text/javascript">
var w = screen.width;
var h = screen.height;

document.write("<? $width "+w+"$height "+h+"?>");

</script>

<?

echo '<style type="text/css"> #ciao { width: '.$width.'; height: '.$height.' } </style>';

?>