LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 01-31-2005, 12:44 PM   #1
feetyouwell
Member
 
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, 12:48 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

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


Reply



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 01:32 PM
Question about php.ini file. jon_k Linux - Software 0 08-07-2004 05:52 AM
unknown filter was no added: PHP drenal Linux - Software 1 01-24-2004 08:03 PM
PHP log file question. hct224 Linux - Newbie 2 11-11-2003 03:28 PM
editing PHP.INI file question hct224 Linux - Newbie 1 10-31-2003 10:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:31 AM.

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