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

JS - Using PHP inside js code

0 votes
25 views
added Dec 17, 2020 in Javascript by lcjr Second Warrant Officer (3,760 points)
<html>
    <body>
    <?php
        $myScript = "Hey World!";
    ?>
    <script type="text/javascript">
        document.write("<?php echo $myScript ?>");
    </script>
    <?php
    //....php code...
    ?>
    </body>
</html>

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...