I have a file that contains, among others, some links to other files. Those files contain links to other files and so on.
What I want to do is to check if a file has already been opened, and if this is true I want the file not to be opened again.
For this I created an array, but when the code returns to the first file the array is reseted. Can someone please help me?
This is the code I created (I`m a beginer in php). Thanks
function readImportFiles($taxonomyFile, $target_path, $fileName='', $ArrayOfTaxonomies = array())
{
while(!feof($taxonomyFile))
{
$line = fgets($taxonomyFile);
//code for getting the $schemaLocation
if ($schemaLocation && !in_array($schemaLocation, $ArrayOfTaxonomies))
{
$ArrayOfTaxonomies[]= $schemaLocation;
$importSchema = fopen($schemaLocation, "r");
$target_path = substr($schemaLocation, 0, (strlen($schemaLocation) - strlen(strrchr($schemaLocation, "/"))));
readImportFiles($importSchema, $target_path, $schemaLocation, $ArrayOfTaxonomies);
}
}
}