Jump to content

How to search for partic article type (ie. php xml)


All4172

Recommended Posts

I have the following script that list the files in a dir (I use php 4 so can't use scandir).

[code]
<?php
if ($handle = opendir('/home/public_html/dir')) {
    echo "Directory handle";

    // List all the files
    while (false !== ($file = readdir($handle))) {
        echo "$file\n";
        echo "<P>";
    }

    closedir($handle);
}
?>
[/code]

How would I go about adding something saying, only display files that end in say .php or .xml ect?

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.