Are you first timer at lazacode.org? Why not join us and start exchange your knowledge with everyone. Register today!

Sharing/Passing PHP variables to Javascript

0 votes
6 views
added Dec 18, 2017 in PHP by LC Marshal Second Warrant Officer (3,400 points)

<?php
  $state  = $item['state'];
  $area  = $item['area'];
  $developer = $item['developer_name'];
?>

<script>
  var state = "<?php echo $state ?>"; 
  var area = "<?php echo $area ?>"; 
  var developer = "<?php echo $developer ?>"; 
</script>

   

Please log in or register to response this solution.

...