<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/php/tags/directory</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 14:58:46 GMT</pubDate>
<item>
<title>(PHP) List Directory Contents in PHP - apphp-snippets</title>
<link>http://snipplr.com/view/70080/list-directory-contents-in-php/</link>
<description><![CDATA[ <p>This code allows to list the contents of any given directory.</p> ]]></description>
<pubDate>Sun, 24 Feb 2013 20:17:46 GMT</pubDate>
<guid>http://snipplr.com/view/70080/list-directory-contents-in-php/</guid>
</item>
<item>
<title>(PHP) Fix Timthumb Script When Using a URL That Contains Tildes (~) - tacudtap</title>
<link>http://snipplr.com/view/69694/fix-timthumb-script-when-using-a-url-that-contains-tildes-/</link>
<description><![CDATA[ <p>If you are using the [TimThumb](http://code.google.com/p/timthumb/ "TimThumb on Google Code") script with a URL the contains tildes (~) and images are breaking, here is the fix...

I did not create this snippet but found it extremely useful so I thought I'd make it available here. The URL listed is not mine but where I found it. Enjoy :-)

At line 209 (as of 01-29-13) in the script you will find the following line of code:

`$this->src = $this->param('src');`

Replace that line with the following snippet:</p> ]]></description>
<pubDate>Wed, 30 Jan 2013 02:24:32 GMT</pubDate>
<guid>http://snipplr.com/view/69694/fix-timthumb-script-when-using-a-url-that-contains-tildes-/</guid>
</item>
<item>
<title>(PHP) list all files in directory - ne7son</title>
<link>http://snipplr.com/view/65972/list-all-files-in-directory/</link>
<description><![CDATA[ <p>list all files in directory and subdirectory</p> ]]></description>
<pubDate>Thu, 05 Jul 2012 23:35:04 GMT</pubDate>
<guid>http://snipplr.com/view/65972/list-all-files-in-directory/</guid>
</item>
<item>
<title>(PHP) Getting files, folders, file count, folder count in a directory with php - duzenz</title>
<link>http://snipplr.com/view/62962/getting-files-folders-file-count-folder-count-in-a-directory-with-php/</link>
<description><![CDATA[ <p>Getting files, folders, file count, folder count in a directory with php and writing them to a web page</p> ]]></description>
<pubDate>Wed, 01 Feb 2012 06:30:29 GMT</pubDate>
<guid>http://snipplr.com/view/62962/getting-files-folders-file-count-folder-count-in-a-directory-with-php/</guid>
</item>
<item>
<title>(PHP) scan directory - BilalELMoussaoui</title>
<link>http://snipplr.com/view/56895/scan-directory/</link>
<description><![CDATA[ <p>scandir function with more information about the files and folers like the size and mime type</p> ]]></description>
<pubDate>Wed, 20 Jul 2011 07:56:23 GMT</pubDate>
<guid>http://snipplr.com/view/56895/scan-directory/</guid>
</item>
<item>
<title>(PHP) Get Directory List PHP - nebojsac</title>
<link>http://snipplr.com/view/55588/get-directory-list-php/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 22 Jun 2011 23:07:29 GMT</pubDate>
<guid>http://snipplr.com/view/55588/get-directory-list-php/</guid>
</item>
<item>
<title>(PHP) Empty directory recursively in PHP - nilambar</title>
<link>http://snipplr.com/view/48980/empty-directory-recursively-in-php/</link>
<description><![CDATA[ <p>This function empties the folder recursively. Two parameters are passed in the function, First one is the directory to be emptied and second one is the flag to determine whether to delete the given folder. If set 'true', given folder is also removed at last. If emptying is our need then you should pass 'false'.</p> ]]></description>
<pubDate>Mon, 14 Feb 2011 16:21:15 GMT</pubDate>
<guid>http://snipplr.com/view/48980/empty-directory-recursively-in-php/</guid>
</item>
<item>
<title>(PHP) Recursive Glob File Tree - danoph</title>
<link>http://snipplr.com/view/48610/recursive-glob-file-tree/</link>
<description><![CDATA[ <p>There are a lot of recursive glob functions out there but they don't build a tree, they build a 1 dimensional array...This function builds a directory tree.</p> ]]></description>
<pubDate>Tue, 08 Feb 2011 21:41:36 GMT</pubDate>
<guid>http://snipplr.com/view/48610/recursive-glob-file-tree/</guid>
</item>
<item>
<title>(PHP) PHP/HTML/CSS - Script to scan a directoy recursively with filters and/or ingore list - SoN9ne</title>
<link>http://snipplr.com/view/46276/phphtmlcss--script-to-scan-a-directoy-recursively-with-filters-andor-ingore-list/</link>
<description><![CDATA[ <p>There seems to be many scan directory systems but I could not find one that works the way I needed. I added in functionality for a search filter and an ignore list. The search filter and ignore list can ignore by extension, file (case-sensitive file name), and directory. I also added in the ability to have a max depth for the scan.

The HTML and CSS that are in the script is to preview in the browser the output. If you scan a directory that is outside the webroot then the links will not be built properly. I did not care to resolve this issue as it was not a problem for me.

I tested the script in Strict mode and have no errors, warnings, or notices. Pasting this here for a few friends and the community. If you can improve the script, please let me know as I always enjoy learning new techniques.

Thanks,
SoN9ne</p> ]]></description>
<pubDate>Thu, 30 Dec 2010 09:44:08 GMT</pubDate>
<guid>http://snipplr.com/view/46276/phphtmlcss--script-to-scan-a-directoy-recursively-with-filters-andor-ingore-list/</guid>
</item>
<item>
<title>(PHP) Map a Directory - mscribellito</title>
<link>http://snipplr.com/view/45496/map-a-directory/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 09 Dec 2010 12:59:18 GMT</pubDate>
<guid>http://snipplr.com/view/45496/map-a-directory/</guid>
</item>
<item>
<title>(PHP) RSS Feed Folder v1.1 - karlhorky</title>
<link>http://snipplr.com/view/43740/rss-feed-folder-v11/</link>
<description><![CDATA[ <p>This script is a modification of the RSS Feed Folder script available at http://www.rssFeedFolder.com/ . The original script created an RSS feed based on the latest changed  files by html title and meta description tags. My modification removes the html components of the original script, instead aiming to generate an RSS feed with the latest files (recursive) in the specified directory.


The updated script achieves this by looping recursively through all directories that it finds within the specified path and listing out the file names and modification times (filemtime) as it goes. Once it has an array of all filenames with their modification times, it reverse sorts this list and does an array_slice on the first $rssMaxItems to be displayed. Finally, the script echos all the items in RSS format.</p> ]]></description>
<pubDate>Mon, 08 Nov 2010 11:05:02 GMT</pubDate>
<guid>http://snipplr.com/view/43740/rss-feed-folder-v11/</guid>
</item>
<item>
<title>(PHP) match_files_in_directory - mattkenefick</title>
<link>http://snipplr.com/view/43075/matchfilesindirectory/</link>
<description><![CDATA[ <p>Returns an array of files that match a search term in a certain directory.</p> ]]></description>
<pubDate>Thu, 28 Oct 2010 02:59:22 GMT</pubDate>
<guid>http://snipplr.com/view/43075/matchfilesindirectory/</guid>
</item>
<item>
<title>(PHP) PHP list directory - nveselinov</title>
<link>http://snipplr.com/view/42077/php-list-directory/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 12 Oct 2010 04:06:25 GMT</pubDate>
<guid>http://snipplr.com/view/42077/php-list-directory/</guid>
</item>
<item>
<title>(PHP) Create Directory Path - iloveitaly</title>
<link>http://snipplr.com/view/40543/create-directory-path/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 16 Sep 2010 01:26:56 GMT</pubDate>
<guid>http://snipplr.com/view/40543/create-directory-path/</guid>
</item>
<item>
<title>(PHP) Load Folder into PHP array - sandman7OR</title>
<link>http://snipplr.com/view/38711/load-folder-into-php-array/</link>
<description><![CDATA[ <p>Loops through all files of a certain extension in the specified directory.  Can be used to list all images in a given directory.</p> ]]></description>
<pubDate>Sun, 08 Aug 2010 07:59:39 GMT</pubDate>
<guid>http://snipplr.com/view/38711/load-folder-into-php-array/</guid>
</item>
<item>
<title>(PHP) Función para obtener el tamaño de un directorio - jrobinsonc</title>
<link>http://snipplr.com/view/38632/funcin-para-obtener-el-tamao-de-un-directorio/</link>
<description><![CDATA[ <p>Función para obtener el tamaño de un directorio:</p> ]]></description>
<pubDate>Fri, 06 Aug 2010 22:00:51 GMT</pubDate>
<guid>http://snipplr.com/view/38632/funcin-para-obtener-el-tamao-de-un-directorio/</guid>
</item>
<item>
<title>(PHP) Include All PHP Files in a Directory - chrisdpratt</title>
<link>http://snipplr.com/view/33851/include-all-php-files-in-a-directory/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 04 May 2010 10:06:56 GMT</pubDate>
<guid>http://snipplr.com/view/33851/include-all-php-files-in-a-directory/</guid>
</item>
<item>
<title>(PHP) Comfortable directory contents with filters - Lostindream</title>
<link>http://snipplr.com/view/29720/comfortable-directory-contents-with-filters/</link>
<description><![CDATA[ <p>Very simple to use.

**Calling:**

    $files = dirContents(DIR_PATH, [FILTER, [TYPE]]);

**Examples:**

    $files = dirContens("my-dir");
_$files_ is array containing all, both files either directories

    $files = dirContens("my-dir", "img[0-9]");
_$files_ is array containing files or directories with 'img0', 'img1', 'img2', etc. in their names

    $files = dirContents("my-dir/", "\.php", 1);
_$files_ is array containing only files with '.php' in their names

**Tip:**
After calling _dirContents()_ try to call *print_r* for showing the array of files

    echo '';
    print_r($files);
    echo '';

Thank you for your comments.</p> ]]></description>
<pubDate>Sat, 13 Mar 2010 14:24:14 GMT</pubDate>
<guid>http://snipplr.com/view/29720/comfortable-directory-contents-with-filters/</guid>
</item>
<item>
<title>(PHP) Easy folder structure set up - chlab</title>
<link>http://snipplr.com/view/28038/easy-folder-structure-set-up/</link>
<description><![CDATA[ <p>Here is a function you can use to automatically set up a complex folder structure with a specified file mode. All you have to do is create the "root" directory and pass an array describing the folder structure you would like to create in it. If the directory already contains a part of the desired directory structure, the script will set the specified file mode on every existing folder. There's an example how to use the function at the bottom of the snippet.

I use this to set up user home's. I tested this with PHP 5.2.11 on Apache running on Mac OS X. It should work on most Linux servers. It won't work on Windows.

This function should be easy to modify for your needs or integrate into a class. Have fun.</p> ]]></description>
<pubDate>Tue, 09 Feb 2010 09:34:41 GMT</pubDate>
<guid>http://snipplr.com/view/28038/easy-folder-structure-set-up/</guid>
</item>
<item>
<title>(PHP) PHP recursive remove directory - ginoplusio</title>
<link>http://snipplr.com/view/27562/php-recursive-remove-directory/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 02 Feb 2010 10:50:52 GMT</pubDate>
<guid>http://snipplr.com/view/27562/php-recursive-remove-directory/</guid>
</item>
</channel>
</rss>