$ext_check = $dirobj->check_file_extension($pathtodir . 'Malta 1266.jpg', 'jpg'); echo "czy rozszerzenie jpg : {$ext_check}"; echo '<br />'; $typ_mime = $dirobj->get_mime_content_type($pathtodir . 'class_dirtool-2005-12-29.zip'); //$typ_mime = mime_content_type($pathtodir . 'class_dirtool-2005-12-29.zip'); echo '<br />'; echo 'get_most_recent_file<br /> '; $myList = $dirobj->get_most_recent_file(null, $pathtodir, true); print_r($myList); echo '<br />'; echo date($dirobj->datetime_format, $myList['last_modified']); echo '<br />'; echo '<br />'; echo '<br />'; echo '<br />'; $myList = $dirobj->get_sorted_dirlist(null, $pathtodir, true); echo 'lista folderow sort : '; print_r($myList); echo '<br />'; $myList = $dirobj->get_sorted_filelist(null, null, $pathtodir, true); echo 'lista plików sort : '; print_r($myList); echo '<br />'; $myList = array_merge($dirobj->get_sorted_dirlist(null, $pathtodir, true), $dirobj->get_sorted_filelist(null, null, $pathtodir, true)); echo 'razem sort : '; print_r($myList); echo '<br />'; echo '<br />'; echo '<br />'; echo '<br />'; echo 'szczegoly na temat pliku<br />';
<p>Oh and while we are at it, let's also get the directory size of the total list:</p> <code>$rdb_dirsize = $dirobj->get_human_readable_dirsize();</code> <p>Only method 1 applies as we haven't got a size yet</p> <?php print '<pre>' . $dirobj->get_human_readable_dirsize() . '</pre>'; ?> <h2>Example 6</h2> <p>Ok, now I want to show ONE sorted list of all directories and the selected files with directories at the top, sorted in reverse order</p> <code>$myList = array_merge( $dirobj->get_sorted_dirlist( false), $dirobj->get_sorted_filelist( false, true ) );</code> <?php print '<pre>'; print_r(array_merge($dirobj->get_sorted_dirlist(false), $dirobj->get_sorted_filelist(false, true))); print '</pre>'; ?> <h2>Example 7</h2> <p>But heck.. this class can do more, you can just pass it a path to a file and get information about the file (independently of getting the file through a directory listing using this class)</p> <p>For the purpose of this example, I use the first file in your filelist - but you can just point the class to any file you like.</p> <?php $pathtofile = $dirobj->filelist[0]; //$pathtofile = $pathtodir . 'example/example.php'; print '<pre>filename is : <i>' . $pathtofile . '</i></pre>'; print '<pre>$dirobj->get_mime_content_type( $pathtofile )' . "\n\n"; print 'mimetype is : <i>' . $dirobj->get_mime_content_type($pathtofile) . '</i></pre>'; print '<pre>$dirobj->check_file_extension( $pathtofile, \'jpg\' )' . "\n\n";