A small php library that handles some common functions needed for local files.
And then run composer install
from the terminal.
Use the following command in your terminal:
composer require "michaeldrennen/local-file"
use MichaelDrennen\LocalFile\LocalFile;
$lineCount = LocalFile::lineCount('/path/to/your/file.txt);
echo $lineCount;
use MichaelDrennen\LocalFile\LocalFile;
$splitFilePaths = LocalFile::split('/path/to/your/file.txt);
print_r($splitFilePaths);