Griffith Designs

PHP

Coldfusion >= PHP

by webmasterjunkie on Mar.28, 2011, under Coldfusion, PHP, Programming

Well, I have the ability to work with Coldfusion a lot lately, and am asking myself if it is worth the learning curve? There is of course a bias since any of you that are actually reading this know that I <3 PHP. There are some cool things that I have learned like there are no actual code declaration tags and built in JS form validation, but I am still waiting to see.

Leave a Comment :, more...

Website Design

by webmasterjunkie on Mar.18, 2011, under Designs, Internet, MySQL, PHP, Service, Web

Well, I have almost finished the new design for the site so I can drop this sql killing WordPress site – even though I have put a lot of work into it! CSS3 + HTML5 are the main goals of this layout. I have been looking into the pixel grid system for this too, but not sure if I want to go through that process.

Leave a Comment :, , more...


PHP Empty a Folder

by webmasterjunkie on Oct.30, 2010, under Designs, Internet, PHP, Programming, Service, Web

Well been working on some cron jobs for my latest site, and had to find a way to dump all the files in the temporary folder. If you are looking to do this in PHP, here you go:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function empty_directory_folder ($dir, $deleteMe) {
    if (!$dh = @opendir ($dir)) return;
    while (false !== ($obj = readdir($dh))) {
        if($obj == '.' || $obj == '..') continue;
        if (!@unlink ($dir . '/' . $obj)) empty_directory_folder ($dir . '/' . $obj, true);
    }
    closedir ($dh);
    if ($deleteMe){
        @rmdir ($dir);
    }
}
// Call the function like this
// You can change the second argument to true if you want to delete the folder too
empty_directory_folder ('../tmp', false);
Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Connect