Jump to content

excluding files with "-" in them


Twentyoneth

Recommended Posts

try something like this:

[code]
<?php
if ($handle = opendir($pathToFiles)) {

  while (false !== ($file = readdir($handle))) {
    if (!preg_match('|-|', $file)) {
      // there is no '-' in the name
      include("$pathToFiles/$file");
    }
  }
  closedir($handle);
}
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.