So I have a class in which I have a function to unzip an array of files. Here is the relevant part of the code:
private function unzipFiles()
{
$this->fileNames = array("file1.zip");
$this->terminalPrint("Starting to unzip files...");
foreach($this->filenames as $file)
{
$this->terminalPrint("Unzipping $file");
..... //other operations
}
$this->terminalPrint("Finished uzipping files...");
My problem is that when I call this function it prints Starting to unzip files... but never goes inside the loop to print Unzipping file1.zip. Neither does it exit abnormally or anything. It just conveniently skips the foreach loop and prints Finished uzipping files...
I tried giving multi-index array like array("file1.zip","file2.zip","file3.zip"); but it just does not get inside the loop! Might be something really small, but I have been at it for so long that I thought maybe I might ask help from a fresh pair of eyes...
Thank you!!
$this->fileNames = array("file1.zip");to$fileNames = array("file1.zip");