Posted 26 July 2006 - 02:01 AM
$a = require('a.php');
The problem I'm having is that b.php will echo "hey" even if I don't include the second line. When I do include the second line, it says:
Parse error: syntax error, unexpected $end eval()'d code on line 1
I want to set the evaluated a.php to a variable, and then change the value of the variable. So I'm altering what was already included. Make sense? I hope so.
<a href="http://www.spreadfir...;t=219"></a><br />
Posted 26 July 2006 - 02:05 AM
No you cannot assign a require call to a var but any var declared in the required file WILL become available to the file that included it.
For example this will work:
$a = 'lol';
echo $a; // Produces 'lol'
Posted 26 July 2006 - 02:25 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users