Lets say I have about 4 php files within a directory. I want to include all those files... but I only want to get a certain variable from those pages to be displayed on one page.
Inside each file, "ResourceFile-1.php, ResourceFile-2.php, etc," is a variable set as....
...respectively.
I know the include(), or include_once() isn't the way to go in the glob() script. I don't want all the variables on the ResourceFiles-*.php, just one specific one, so that It'll echo "Content 1, Content 2," etc.
Sorry if my wording is a bit weird, I really can't think of a better way to put it. How would I go about doing this?
PHP:
foreach(glob("ResourceFile-*.php") as $GlobalFile)
{
include_once($GlobalFile);
echo $Variable;
}
Inside each file, "ResourceFile-1.php, ResourceFile-2.php, etc," is a variable set as....
PHP:
$Variable .= "Content 1";
I know the include(), or include_once() isn't the way to go in the glob() script. I don't want all the variables on the ResourceFiles-*.php, just one specific one, so that It'll echo "Content 1, Content 2," etc.
Sorry if my wording is a bit weird, I really can't think of a better way to put it. How would I go about doing this?