How can I do php variable in alert function ?

How can I do php variable in alert function ?

What is the problem here?  Help me please  ...

<head>
<script type="text/javascript">

    function funk(yy) {
        alert(yy);
        }
       
</script>
</head>
<body>

<?php $deg='Lorem ipsum dolor sit amet';?>

<script type="text/javascript">

        var xx=<?php echo $deg;?>;
        funk(xx);
       
</script>

</body>
</html>