system("rm -r $path");
Effective, but dangerous, too. Fortunately, if Apache is running as <b>nobody</b> you can't damage the system itself if $path points to some surprising place, but if you've given write access to stuff in DOCUMENT_ROOT your web content could get blown away.