hey guys need help to solve a issue in code
example if $dcc= 4 then the loop will execute 3 times
this loop on start where $i = 0 ,$arr (['dir'=>$curr[$i],'files'=>''];) is created on next where $i=1 ,i need to insert the same array (['dir'=>$curr[$i],'files'=>'']) into array key ['files'] of the last array.
for demo:
array(
dir=>folder, files=> array(
dir=>folder, files=>array(
dir=>folder, files=>..);
);
)'
i want to create a array like above
if you guys help then the file tree can be completed
for($i=0;$i<$dcc;$i++){
if($i==$dcc){
$sel = ['name'=> $curr[$i], 'size'=>$curr_len];
$arr
}elseif($i=='0'){
$arr = ['dir'=>$curr[$i],'files'=>''];
// print_r($arr);
}else{
// $sel = ['dir'=>$curr[$i],'files'=>''];
$arr['files'] = ['dir'=>$curr[$i],'files'=>''];
}
}
example if $dcc= 4 then the loop will execute 3 times
this loop on start where $i = 0 ,$arr (['dir'=>$curr[$i],'files'=>''];) is created on next where $i=1 ,i need to insert the same array (['dir'=>$curr[$i],'files'=>'']) into array key ['files'] of the last array.
for demo:
array(
dir=>folder, files=> array(
dir=>folder, files=>array(
dir=>folder, files=>..);
);
)'
i want to create a array like above
if you guys help then the file tree can be completed
follow the thread for updates
checkout my project: https://bvlist.com/showthread.php?t=12349
checkout my project: https://bvlist.com/showthread.php?t=12349
Last edited by JohnHasher on 2022-01-16 17:18:47

