What are the best practices for including JavaScript code in PHP files for a website?

When including JavaScript code in PHP files for a website, it is best practice to separate the JavaScript code from the PHP logic for better organization and maintainability. One common approach is to use the `<script>` tag within the HTML portion of the PHP file to include external JavaScript files or inline JavaScript code.

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;My Website&lt;/title&gt;
    &lt;script src=&quot;myscript.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php
    // PHP logic here
    ?&gt;
&lt;/body&gt;
&lt;/html&gt;