<?php 
class MusicModel
{
    static function getData()
    {
        $box = [];
        if ($handle = opendir('./uploads')) {
            while (false !== ($entry = readdir($handle))) {
                $ext = pathinfo($entry, PATHINFO_EXTENSION);

                if ($ext == 'mp3') {
                    array_push($box, "./uploads/$entry");
                }
            }
            closedir($handle);
        }
        return $box;
    }
}
