What are the differences between server-side PHP and client-side JavaScript in terms of function calling?

When it comes to function calling, server-side PHP executes functions on the server before sending the final output to the client. On the other hand, client-side JavaScript executes functions on the client's browser after the page has been loaded. This means that PHP functions are called and executed on the server, while JavaScript functions are called and executed on the client side.

// Server-side PHP function calling
function greet($name) {
    return "Hello, $name!";
}

echo greet("John"); // Output: Hello, John!