I have this code :
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
print_r(" ".$file. " ");
$data = array(
'emplacement' => 'uploads/slidesFiles/'.$file
);
$jpgId = $CI->dataaccess::InsertJpg($data);
$data = array(
'idSlideZip' => $zipId,
'idSlideJpg' =>$jpgId
);
$CI->dataaccess::InsertJpgToSlide($data);
}
closedir($dh);
}
}
My folder :
But when I am using the read dir function to loop into my folder, I dont have the expected order wich is the next :
I tried to reorder with the sort function but that is not the result expected.
Any idea ?