PHP code example of king52311 / yii2-filemanage
1. Go to this page and download the library: Download king52311/yii2-filemanage library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
king52311 / yii2-filemanage example snippets
use king52311\filemanage\Filemanage;
......
public function actionTest2()
{
$list = Filemanage::showFileList('./','/base/path/','aaa.txt');
var_dump($list);exit;
}
php composer.phar
... ...
8 =>
array (size=4)
'file_path' => string './files/' (length=8)
'file_name' => string 'files' (length=5)
'file_type' => int 2
'file_ids' => string '' (length=0)
9 =>
array (size=4)
'file_path' => string './index.php' (length=11)
'file_name' => string 'index.php' (length=9)
'file_type' => int 1
'file_ids' => string '' (length=0)
10 =>
array (size=4)
'file_path' => string './robots.txt' (length=12)
'file_name' => string 'robots.txt' (length=10)
'file_type' => int 1
'file_ids' => string '' (length=0)
11 =>
array (size=4)
'file_path' => string './test.php' (length=10)
'file_name' => string 'test.php' (length=8)
'file_type' => int 1
'file_ids' => string '' (length=0)
... ...
file_type: 1 file 2 directory