I am trying to make some kind of file tree from full path lines.
This is what I use php class:
/RootFolder/Folder1/File1.doc /RootFolder/Folder1/SubFolder1/File1.txt /RootFolder/Folder2/SubFolder1/File2.txt /RootFolder/Folder2/SubFolder1/SubSubFolder1/File4.doc
I thought I could create such an array:
array ( "RootFolder" => array ("Folder1" => array ("FILE" => "File1.doc" "SubFolder1" => "File1.txt" "SubFolder1" => "File2.txt" ) "Folder2" => array ( ... ) ) )
To get this result with <li> or in <table> :
RootFolder/ |_ Folder1/ | |_ SubFolder1/ | | |_ File1.txt | | |_ File2.txt | |_ File1.doc | |_ Folder2/ |_ SubFolder1/ |_ SubSubFolder1/ |_ File2.txt
I focus on this because I'm a little confused and, of course, I'm not a developer.
Is there any other way to do this? I think I will have about> 10,000 lines of file to continue when the page is loaded.
EDIT:
Actually, I have a php object that returns me arrays like this:
Array ( [0] => Transmission\Model\File Object ( [name:protected] => RootFolder/Folder1/File1.jpg [size:protected] => 13324 [completed:protected] => 13324 [client:protected] => ) [1] => Transmission\Model\File Object ( [name:protected] => RootFolder/Folder1/File2.mp3 [size:protected] => 10383488 [completed:protected] => 10383488 [client:protected] => ) [2] ... )
What I want to do is to make some kind of file tree table with the name, size and status of the current file. I am based on this http://labs.abeautifulsite.net/archived/phpFileTree/demo/demo_classic.php .
Using this object, data can be obtained using $ var-> getName (), $ var-> getsize () and $ var-> isDone ().