I have these variables that are set in one php file, and when i include that php file in another php file, how do i use those variables from the included php file?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
When you include one file in another, everything is visible from both of them. Imagine them as having one file, so you use the variables the regular way - by typing their name out.
They should just roll over:
File1.php
File2.php
Have you actually tried it?
Just use the variables. They are available within the scope of the including file.
From the PHP manual: