-3

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?

Matteo Tassinari
  • 18,121
  • 8
  • 60
  • 81

1 Answers1

0

use include_once / require_once "file2" inside file1 and call the "somefunction" with $variable as argument.