I have below js code
<script type="text/javascript">
var jvalue = 'Hi, $name';
</script>
And this is my php code
<?php
$name= "Rama";
$abc = "<script>document.write(jvalue)</script>";
echo $abc;
?>
This is giving me output
Hi, $name
Instead of
Hi, Rama