How can the issue of JS code being displayed on the page instead of executing be resolved in PHP?
The issue of JS code being displayed on the page instead of executing can be resolved by using the PHP `echo` function to output the JS code within `<script>` tags. This will ensure that the JS code is interpreted by the browser as script to be executed, rather than displaying it as plain text.
<?php
echo '<script>';
echo 'alert("Hello, World!");';
echo '</script>';
?>