Since PHP is processed server-side, and JavaScript is processed client-side, you can do this, but only from PHP to JS, not the onther way around...
<?
$value = "4";
?>
<script language='JavaScript'>
var value = <? echo $value; ?>;
</script>
when the script is processed, it will simply spit out:
<script language='JavaScript'>
var value = 4;
</script>
-=Lazzerous=-