I\'m trying to pass a variable into an include file. My host changed PHP version and now whatever solution I try doesn\'t work.
I think I\'ve tried every op
I know this is an old question, but stumbled upon it now and saw nobody mentioned this. so writing it.
The Option one if tweaked like this, it should also work.
The Original
Option One
In the first file:
global $variable; $variable = "apple"; include('second.php');In the second file:
echo $variable;
TWEAK
In the first file:
$variable = "apple";
include('second.php');
In the second file:
global $variable;
echo $variable;