LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   php filter file name question (https://www.linuxquestions.org/questions/programming-9/php-filter-file-name-question-284533/)

feetyouwell 01-31-2005 12:44 PM

php filter file name question
 
I borrowed a php script which will display all the file names under the specified directory, how can i even filter it more, i only want files that has .php extension to get print out. which php function can i use to do that? thanks.

keefaz 01-31-2005 12:48 PM

use glob() function for that
PHP Code:

$files glob("/path/to/dir/*.php");
print_r($files); 



All times are GMT -5. The time now is 07:42 AM.