Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $myVariable = 'Hello, world!';
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <script>
- var myVariable = '<?php echo $myVariable; ?>';
- </script>
- <body>
- <script>
- alert(myVariable); // should alert 'Hello, world!'
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment