loops - PHP for directory listing -
i wont list set of files in directory , files in sub directory using loop rather function im getting information directory through xml based webdav , php native functions infertile please understand issue has not yet been lodged here $urlloc used remove same directory being looped again
foreach ($xml $key) { if(empty($key->propstat->prop->resourcetype[0])){ echo $key->href."<br/>";//files printed, debugging perposes im printing }else{ $nurlloc=$key->href; if ($nurlloc!=$urlloc){ echo "<b>".$nurlloc."</b><br/>";//directorys printed in bold debugging $urlloc=$nurlloc; //gtndirdown()
above method im getting know if directory or not note want able make code loop through , me files in directory post array of files im getting
[response] => array ( [0] => simplexmlelement object ( [href] => /dav/product_images/ [propstat] => simplexmlelement object ( [prop] => simplexmlelement object ( [resourcetype] => simplexmlelement object ( [0] => simplexmlelement object ( ) ) [quota-used-bytes] => 2147483647 [quota-available-bytes] => 2147483647 ) [status] => http/1.1 200 ok ) ) [1] => simplexmlelement object ( [href] => /dav/product_images/a/ [propstat] => simplexmlelement object ( [prop] => simplexmlelement object ( [resourcetype] => simplexmlelement object ( [0] => simplexmlelement object ( ) ) [quota-used-bytes] => 2147483647 [quota-available-bytes] => 2147483647 ) [status] => http/1.1 200 ok ) )
iv been stuck in issue 4 days , have if 1 come logic issue
maybe idea can implement in logic
// name of directory $dir='path_to_your_directory'; $files = array_slice(scandir($dir), 2); print_r($files);
Comments
Post a Comment