Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-31-2005, 01:44 PM   #1
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
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.
Old 01-31-2005, 01:48 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
use glob() function for that
PHP Code:
$files glob("/path/to/dir/*.php");


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[error] an unknown filter was not added: PHP ProTrooper Linux - Networking 2 10-26-2005 02:32 PM
Question about php.ini file. jon_k Linux - Software 0 08-07-2004 06:52 AM
unknown filter was no added: PHP drenal Linux - Software 1 01-24-2004 09:03 PM
PHP log file question. hct224 Linux - Newbie 2 11-11-2003 04:28 PM
editing PHP.INI file question hct224 Linux - Newbie 1 10-31-2003 11:05 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration