How about:
<?php
$var1 = "Hello";
$var2 = "Goodbye";
$var3 = "Nice";
$i = rand(1, 3);
echo ${"var" . $i}
?>
At run time ${"var" . $i}
is calculated to be $var1
, $var2
or $var3
.
Using php rand and dynamically created variable will let you do it. You can just continue to include your other files above this script and ensure the variables are named in a static way as shown above and it will work.
Example: Here (click edit then ideoneit)