I am trying to prevent some of my variables from being accessed from other PHP files but am having trouble accessing the variables defined outside of a function without creating a global variable. I need the variables to be reused in several functions inside the scope but not outside of the file. Any ideas?
(function() {
$myVariable = 'string';
function customFunction() {
// how do I access $myVariable without declaring it as a global?
}
})();