Yes you!! can put PHP into javascript but PHP will be executed first and thus it will only print whatever you have specified into the javascript code. Like in this example:
<?php
$myname="ronaldinho gaucho";
?>
<script type="text/javascript">
function showMyName()
{
alert("My name is "+<?php echo "\"".$myname."\""; ?>);
}
</script>
<body onload="showMyName()">
</body>
Note that this must be placed inline. It cannot be placed in an external javscript file!!