By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

Searching for a file if I only part of the name

P: n/a
Hi,

Using PHP 4.4.4.

What is the easiest way to return the full path of a file if I know
the directory it is in and the beginning part of the file (it will
begin with the word "header")?

Thanks, - Dave

Feb 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rik
On Fri, 23 Feb 2007 18:17:36 +0100, la***********@zipmail.com
<la***********@zipmail.comwrote:
Hi,

Using PHP 4.4.4.

What is the easiest way to return the full path of a file if I know
the directory it is in and the beginning part of the file (it will
begin with the word "header")?
<?php
$dir = getcwd();
chdir('/path/to/you/dir');
$matches = glob('header*');
chdir($dir);
?>

--
Rik Wasmus
Feb 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.