I need a code that deletes every file in a special folder with special name but every suffix.
For example:
sample.txt
sample.jpg
sample.pdf
sample.png
I work with Zend Framework. Has zend any tools for deleting files?
I need a code that deletes every file in a special folder with special name but every suffix.
For example:
sample.txt
sample.jpg
sample.pdf
sample.png
I work with Zend Framework. Has zend any tools for deleting files?
look on unlink function
<?php
$mask = "sample.*"
array_map( "unlink", glob( $mask ) );
?>
There is a Zend_File class in Zend Framework. But as you may read in the documentation it provides functionality for transferring and validating files.
Since Zend Framework is written in PHP you can use default delete() or unlink() method, e.g.
$filename = "myfile.txt";
unlink($filename);