how to recieve data from php using js code example Example: php pass a variabele to js <script> 'var name = <?php echo json_encode($name); ?>; </script>'