Jump to content

Variables


ryan.od

Recommended Posts

Imagine you have a file that includes a second file. If a variable is declared in the first file, can it be accessed in the second file? It seems to me a variable declared inside <?php ?> is not available outside of it.

If this is true, how can I assign the root directory location to a variable in the index.php file and get to it in all the included files? I would rather not declare it in every file.

Thanks.

RyanOD
Link to comment
https://forums.phpfreaks.com/topic/27414-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.