Jump to content

Is there any way too pass variables through include files.


Orionsbelter

Recommended Posts

You can pass variable like this:

 

$var1 = one;
include("file.php");

 

$var1 will be available inside file.php.

 

If you are using include() with a url instead of a filename, don't do that - you should be using file_get_contents().  In that situation you do need to pass variable a different way, so let me know if you are using urls.

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.