I have 2 files:
file1 - variables.php
$variable = something;
and file2 - functions.php
function somefunction() {
do_something_with $variable;
}
How can I use variable, defined in one file, in function defined in second file?
I have 2 files:
file1 - variables.php
$variable = something;
and file2 - functions.php
function somefunction() {
do_something_with $variable;
}
How can I use variable, defined in one file, in function defined in second file?
use include_once / require_once "file2" inside file1 and call the "somefunction" with $variable as argument.