What are the advantages and disadvantages of using include() to read variables from different PHP files into one main file?

Using include() in PHP allows you to read variables from different PHP files into one main file, making it easier to organize and reuse code. However, it can also lead to potential naming conflicts or security vulnerabilities if not used carefully.

// main.php
include 'file1.php';
include 'file2.php';

echo $variableFromfile1;
echo $variableFromfile2;