What is the difference between echo and include in PHP, and how does it relate to executing scripts?
The main difference between echo and include in PHP is that echo is used to output strings or variables directly to the browser, while include is used to include and execute a separate PHP file within the current script. When using echo, the code is executed inline, while include allows you to separate and reuse code across multiple files. To execute scripts using include, you simply specify the file you want to include within your PHP script.
// Using echo to output a string
echo "Hello, World!";
// Using include to execute a separate PHP file
include 'myfile.php';