Learning PHP. Have recursive directory loop issue

后端 未结 4 903
情歌与酒
情歌与酒 2021-01-28 18:32

So, I\'m familiar with Javascript, HTML, and Python. I have never learned PHP, and at the moment, I\'m banging my head against my desk trying to figure out what (to me) seems t

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 18:56

    Ok, this is the best result i've gotten all night. This does 99% of what I need. But I still can't figure out this damn sort issue. This code will go through a list of directories, and create lightbox galleries out of the images in each folder. However, the first image is always the last one in the array, and I can't figure out how the heck to get it to sort normally! Check line 16 to see where I talking about.

    isDot()) continue;
                    $files = $folderItem."/".$fileInfo->getFilename();
                    if ($count == 0){  //This is where my issues start.  This file ends up being the last one in the list.  I need it to be the first.
                        echo ''.basename($folderItem).'' . "
    "; echo "
    " . "
    "; $count++; }else{ echo ''.basename($folderItem).'' . "
    "; } }echo "
    "; } } }

    ?>

提交回复
热议问题