What are the differences between JavaScript and PHP in terms of executing functions on client and server sides?

JavaScript is executed on the client-side, meaning it runs in the user's browser. On the other hand, PHP is executed on the server-side, meaning it runs on the web server before the webpage is sent to the client. This difference in execution location affects how functions are called and processed in each language. PHP code snippet:

<?php
function greet() {
    echo "Hello, World!";
}

greet();
?>