Method: f::write
Creates a new file
Info
Syntax
f::write($file, $content, $append=false)
Parameters
- $file (string) The path for the new file
- $content (mixed) Either a string or an array. Arrays will be converted to JSON.
- $append (boolean) true: append the content to an exisiting file if available. false: overwrite.
Return (boolean)
Example
f::write('test.txt', 'hello');
// creates a new text file with hello as content
// create a new file
f::write('text.txt', array('test' => 'hello'));
// creates a new file and encodes the array as json