Reading and writing files

The fwriteAllLines, freadAllLines, and freadAllText commands let you execute simple file read/write operations.

Reading from a file

To... Use this command

Opens a file and reads all lines of text into an array of strings.

freadAllLines (string $filename)

Opens a file and reads all text into a string.

freadAllText (string $filename)

Writing to a file

To... Use this command

Writes all lines of text to a file.

fwriteAllLines (string $filename, string$ lines[])

Writes all text from a string to a file.

fwriteAllText(string $filename, string $text)