What are the potential pitfalls of passing variables between included pages in PHP and how can they be avoided?

Passing variables between included pages in PHP can lead to naming conflicts or unexpected variable values if not handled carefully. To avoid these pitfalls, it's recommended to use PHP's superglobal arrays like $_GET, $_POST, or $_SESSION to pass variables securely between pages.

// Page1.php
$variable = "Hello";
include 'Page2.php';

// Page2.php
echo $variable; // This will output "Hello"