Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->load->helper('directory');
- $this->load->helper('file');
- $files = directory_map('./uploads/', 1);
- $test = [];
- if(!empty($files)) {
- foreach ($files as $f) {
- if (strpos($f, '/') === false && $f != 'index.php') {
- $file = $f;
- $explode = explode('_', substr($file, 0, -4));
- $user = $explode[0];
- $month = $explode[1];
- $year = $explode[2];
- $timestamp = strtotime($year . '-' . $month . '-15 00:00:00');
- $i = (isset($test[$year][$user])) ? count($test[$year][$user]) : 0;
- $test[$year][$user][$i]['month'] = $this->months[intval(date('n', $timestamp))];
- $test[$year][$user][$i]['file'] = $file;
- $test[$year][$user][$i]['timestamp'] = $timestamp;
- }
- }
- }
- var_dump($test);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement