What is the difference between PHP and JavaScript in web development?
PHP is a server-side scripting language used for web development, while JavaScript is a client-side scripting language. PHP code is executed on the server before the page is sent to the client's browser, while JavaScript code is executed on the client's browser. PHP is used for handling server-side tasks like interacting with databases and processing form data, while JavaScript is used for creating dynamic and interactive user interfaces.
<?php
// PHP code example
$name = "John";
echo "Hello, $name!";
?>