In this example, I will tell you how to use PHP code inside Javascript code.
1 2 3 4 | <?php $courses = "I love t4tutorials.com"; ?> <script> alert("<?php echo $courses; ?>"); </script> |
Similar Problems to understand
- How to use HTML code in PHP?
- How to use Javascript code in PHP?
- How to use PHP code in Javascript?
- How to use external CSS in HTML and PHP?
- How to use internal CSS in HTML and PHP?
- How to use inline CSS in HTML and PHP?