您可以,但是最后一个include中的变量将覆盖第一个中的变量:
myfile.php
$var = 'test';
mysecondfile.php
$var = 'tester';
test.php
include 'myfile.php';echo $var;include 'mysecondfile.php';echo $var;
输出:
测试
测试人员
我建议使用不同的变量名。

您可以,但是最后一个include中的变量将覆盖第一个中的变量:
myfile.php
$var = 'test';
mysecondfile.php
$var = 'tester';
test.php
include 'myfile.php';echo $var;include 'mysecondfile.php';echo $var;
输出:
测试
测试人员
我建议使用不同的变量名。