I'm using php dir() function to get files from directory and loop through it.
$d = dir('path');
while($file = $d->read()) {
/* code here */
}
But this returns false and gives
Call to member function read() on null
But that directory exists and files are there.
Also, Is there any alternative to my above code?