W praktyce:
Kod
+Folder .
+Folder1
-dokument tekstowy.txt
-Folder11
-Folder12
-Folder13
+Folder2
+Folder3
-index.php
+Folder1
-dokument tekstowy.txt
-Folder11
-Folder12
-Folder13
+Folder2
+Folder3
-index.php
index.php :
<?php $dir = \".\"; $files = scandir($dir); for($i = 0; $i != $count; $i++){ if($files[$i] != \".\" && $files[$i] != \"..\"){ \"); }else{ \"); } }else{} } ?>
efekt:
Kod
-------------------------------------------
folder1 IS A DIR
folder2 IS A DIR
folder3 IS A DIR
index.php IS NOT A DIR
-------------------------------------------
folder1 IS A DIR
folder2 IS A DIR
folder3 IS A DIR
index.php IS NOT A DIR
-------------------------------------------
Czyli póki co, git! ale gdy zmienię $dir = "."; na $dir = "./folder1";
efekty są następujące:
Kod
--------------------------------------------
dokument tekstowy.txt IS NOT A DIR
folder11 IS NOT A DIR
folder12 IS NOT A DIR
folder13 IS NOT A DIR
--------------------------------------------
dokument tekstowy.txt IS NOT A DIR
folder11 IS NOT A DIR
folder12 IS NOT A DIR
folder13 IS NOT A DIR
--------------------------------------------
Wszystkie foldery to przed chwilą stworzone nowe foldery, dokument tekstowy kontrolnie. Nie mam pojęcia, dlaczego nie daje TRUE dla podkatalogow... może ktoś z was mi coś podpowie. Byłbym bardzo wdzieczny.
Pozdrawiam.
Pogański.