I included all php files of a directory , and it worked just fine
foreach (glob("directory/*.php") as $ScanAllFiles)
{
include_once($ScanAllFiles);
}
but problem is that the content of these files are all like this
$workers = array(
blah,
blah
);
$employers = array(
blah,
blah
);
now when i include all these files , its some how meaningless cause i will have repeated $workers and $employers
and i just want them to be like this
$workers = array()
$workers .=array()
now is there anyway to fetch $vars without editing all php files ?
You’ll have to merge your arrays, by yourself, using for instance the
array_merge()function :PHP will not do this automatically : basically, including a file is exactly like copy-pasting its entire content at the line you put your
includestatement.