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
public static write ( string $file, mixed $content, boolean $append = false ) : boolean | ||
$file | string | The path for the new file |
$content | mixed | Either a string, an object or an array. Arrays and objects will be serialized. |
$append | boolean | true: append the content to an exisiting file if available. false: overwrite. |
return | boolean |