在PHP上制作不同路径的文件夹

时间:2018-09-14 05:36:21

标签: php html

我需要为两个文件夹创建一个不同的文件夹视图,例如,该文件夹位于:C:/ photo / example上,另一个位于:C:/ photostrip / example上,然后单击该文件夹我想要的文件夹的路径 这是代码:

<?php
$folderfoto = 
"photobooth/photobooth/Michelle_Illona_Alexander/Prints/thumb"; //folder 
tempat gambar disimpan  
 $handlefoto = opendir($folderfoto);
$foldervideo ="photobooth/photobooth/Michelle_Illona_Alexander/Animated";
$handlevideo = opendir($foldervideo);
$i = 1;
 //untuk video yang ini 
/*while(false !== ($file = readdir($handlevideo) )){  
if($file != '.' && $file != '..' && pathinfo("$foldervideo/$file", 
PATHINFO_EXTENSION) == "jpg"){
    $file2 = str_replace("_mp4.jpg","",$file);
    $file3 = substr($file,0);
    $file4= substr($file,6);
    $file5= substr($file,15);

    echo '<li><a href="photobooth/photobooth/Michelle_Illona_Alexander/animated/'.$file2.'.mp4"> 
<img 
src="photobooth/photobooth/Michelle_Illona_Alexander/animated/'.$file.'" 
width="300" title="" type="jpg"></a><br/></li>';  
    if(($i % 4) == 0){  
        echo '<br/><br/><br/><br/><br/><br/><br/><br/><br/>';
    }*/ 
 //untuk foto yang ini  
while(false !== ($file = readdir($handlefoto) )){  
if($file != '.' && $file != '..' && pathinfo("$folderfoto/$file", PATHINFO_EXTENSION) == "jpg"){
    $file2 = str_replace("_mp4.jpg","",$file);
    $file3 = substr($file,0);
    $file4= substr($file,6);
    $file5= substr($file,15);
echo '<li><a href="photobooth/photobooth/Michelle_Illona_Alexander/Prints/'.$file4.'">
<img src="photobooth/photobooth/Michelle_Illona_Alexander/Prints/thumb/'.$file.'" width="300" title="" type="jpg"></a><br/></li>';  
    if(($i % 4) == 0){  
        echo '<br/><br/><br/><br/><br/><br/><br/><br/><br/>';
    }


    $i++;
    if($i == 0){
        break;
    }
    }   
}  
?>

0 个答案:

没有答案
相关问题