I'm currently working on a PHP project and I've come across a concept that is a bit confusing to me. I was hoping someone could help me understand the variable scope when using `require_once` in PHP.
To provide some background, I have a main file (`main.php`) where I define several variables that are used throughout the project. In another file (`helper.php`), I need to access those variables. I know that I can use `require_once` to include `main.php` in `helper.php` and have access to its variables, but I'm not sure about the scope of those variables.
My question is: What is the scope of variables when using `require_once` in PHP? Will I be able to access the variables defined in `main.php` in `helper.php` within functions or just in the global scope?
I would really appreciate it if someone could clarify this for me. Thanks!