WP_Filesystem_FTPext::get_contents_array( string $file ): string[]|false

In this article

Reads entire file into an array.

Parameters

$filestringrequired
Path to the file.

Return

string[]|false File contents in an array on success, false on failure.

Source

public function get_contents_array( $file ) {
	$contents = $this->get_contents( $file );
	if ( is_string( $contents ) ) {
		return explode( "\n", $contents );
	}
	return false;
}

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.