Hello,
How do I do that? Is there any method provided by kohana 3?
Hello,
How do I do that? Is there any method provided by kohana 3?
To delete a directory and all this content, you'll have to write some recursive deletion function -- or use one that already exists.
You can find some examples in the user's notes on the documentation page of rmdir ; for instance, here's the one proposed by bcairns in august 2009 (quoting) :
<?php
// ensure $dir ends with a slash
function delTree($dir) {
$files = glob( $dir . '*', GLOB_MARK );
foreach( $files as $file ){
if( substr( $file, -1 ) == '/' )
delTree( $file );
else
unlink( $file );
}
rmdir( $dir );
}
?>
have you tried unlink in the directory ?
chdir("file");
foreach (glob("N*") as $filename )
{
unlink($filename);
}
This deletes filenames starting from N
I'm not sure about Kahone 3, but I'd use a DirectoryIterator() and unlink()in conjunction.