How can one properly define and include JavaScript from an external source in PHP?

To properly define and include JavaScript from an external source in PHP, you can use the `echo` function to output the `<script>` tag with the `src` attribute pointing to the external JavaScript file. This allows you to dynamically include JavaScript files based on certain conditions or variables in your PHP code.

&lt;?php
echo &#039;&lt;script src=&quot;https://example.com/script.js&quot;&gt;&lt;/script&gt;&#039;;
?&gt;