Delete previous file and Create a new one.
App::Utility()->overwriteFile(Data,Path)
Parameter |
Description |
---|---|
Data |
Data to write in the file |
Path |
File path |
See bellow example:
echo App::Utility()->overwriteFile('Hello World',App::Config()->baseDir("/test.txt"));