Re: Only show certain files in directory
| From: | Justin Garrett | Date: | Mon, 26 Aug 2002 04:26:56 +0000 |
| Subject: | Re: Only show certain files in directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114095@lists.php.net to get a copy of this message | ||
There are several regular expression and string matching functions you could
use.
http://www.php.net/manual/en/ref.strings.php
http://www.php.net/manual/en/ref.pcre.php
http://www.php.net/manual/en/ref.regex.php
Justin Garrett
<rdkurth@starband.net> wrote in message
news:176159517453.20020825202955@starband.net...
> I am showing a directory of files and I don't what all the files to
> show on the screen. I was able to get the . and the .. not to show
> with what I have below but there are some other files in there that look
> like this mylist.confg. I don't want them to show in the directory
> list. I tried && $files != "*.config" but this did not work .
> Anybody have an suggestions
>
> if ($handle = opendir('/path/to/list/directory')) {
> while (false !== ($files = readdir($handle))) {
> if ($files != "." && $files != "..") {
> echo $files;
> }
>
>
>
> --
> Best regards,
> rdkurth mailto:rdkurth@starband.net
>