/ Published in: PHP
                    
                                        dir_list('data/', 'txt'); => returns all *.txt files from the data/ folder
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 function get_files_by_ext($path, $ext){ if ($file[0] == '.'){ continue; } $files[] = $file; } } } return $files; } /* ** Example: */ /* returns: Array ( [0] => readme_1.txt [1] => readme_2.txt ) */
Comments
                    Subscribe to comments
                
                