What is the difference between PHP and JavaScript in terms of execution and functionality?

PHP is a server-side scripting language, meaning it is executed on the server before the web page is sent to the client's browser. JavaScript, on the other hand, is a client-side scripting language, meaning it is executed on the client's browser after the web page has been received. PHP is used for server-side tasks like interacting with databases and generating dynamic content, while JavaScript is used for client-side tasks like validating forms and creating interactive user interfaces.

// PHP code snippet
<?php
echo "Hello, World!";
?>