File::content()

Gets the file content.

Table of Contents
  1. Description
  2. Example

Description

File::content(): ?string;

This method returns the file contents as a string if the file exists, otherwise it returns null.

Example

$file = new File('.\path\to\file.txt');

$content = $file->content(); // Returns the file content as a string

File::content()

Gets the file content.

File::size()

Gets the file sizes in human readable string format.