0

my javascript and php code run on server

<script type="text/javascript">  
  var content ='<p><?php echo "Helllo"; ?></p>';
</script>

it work but when i try passed a variable inside php tring:

  <script type="text/javascript">
  var temp = 4444;
  var content ='<p><?php echo '+ temp +'; ?></p>';
</script>

it cant get temp variable; i can echo temp variable in php code. what wrong with my code thank for help.

0 Answers0