PHP: Recursively remove a directory and all files and folder contained within

August 22, 2011

The rmdir function of PHP cannot remove a directory if it has anything inside of it, whether it be files or folders. The following method can be used to recursively remove all the files and folders from the directory, and will remove the directory itself. To use it simply copy the code into your application

PHP: Recursively create directories

August 22, 2011

The mkdir function in PHP is great for creating directories, but what if you need to create a new directory structure? For example, you run mkdir(“/this/is/a/path”) but only “/this” exists. mkdir will fail because /this/is/ does not exist. The way to solve this is to pull the path apart and check each segment to ensure

PHP 5: Recursively move or copy files

July 15, 2011

I was looking for a quick code example on recursively moving files with PHP and I only saw code snippets using PHP 5. I like using the new and powerful features of PHP 5 when doing file system interactions so I wrote two quick PHP 5 functions that will move or copy directories and files

A quick look at the upcoming packaging tool in the Windows Azure SDK for PHP

June 29, 2011

Note: The Windows Azure SDK for PHP referenced in this post has been released and there is official documentation available at http://azurephp.interoperabilitybridges.com/articles/packaging-applications please be sure to also check there as the content in this post may become outdated. The current Windows Azure Command-line tools for PHP can be sometimes difficult and frustrating to work with.

Windows Azure PHP Documentation

June 22, 2011

I was asked to stop by the SQL Server Jumpin camp yesterday and talk to PHP developers about building and migrating applications to Windows Azure. One of the frustrations I heard was a lack of documentation around PHP on Windows Azure. The complaint was that documentation is hard to find because it is scattered around