Is there a way which allows you to delete files with a wildcard in Laravel 5.2.
For example:
File::delete('foo/bar.*');
I asked the question too quickly. When reading the PHPDoc for File::delete()
, i saw you can give an array with paths as parameter.
So this did the trick for me:
File::delete(File::glob('foor/bar.*'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With