Hi experts,
This should be fairly simple. In my PHP app, I'm using a file called PATHS.php to store common data that I want available to different PHP classes / functions / includes.
PATHS.php looks like this:
<?php
$FOO = 'foobar';
$OOF = 'barfoo';
?>
and in my other files I do this:
<?php
include('PATHS.php');
...
echo $FOO; //works
?>
<?php
include('PATHS.php');
...
class Something extends SomethingElse
{
function doSomething() {
echo $FOO; //doesn't work
global $FOO;
echo $FOO; //doesn't work either
}
}
?>
How should I access those variables within the second file?
Many thanks,
Matt.
Start Free Trial