michaeldrennen / local-file
A small php library that adds some functions to operate on local files, like an efficient line count function.
Installs: 20 940
Dependents: 5
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^7.3||^8.0
Requires (Dev)
- mikey179/vfsstream: ^1.6
- php-coveralls/php-coveralls: ^2.4
- phpunit/phpunit: ^9.5
README
A small php library that handles some common functions needed for local files.
And then run composer install
from the terminal.
Quick Installation
Use the following command in your terminal:
composer require "michaeldrennen/local-file"
Usage
Get the number of lines in a file as an integer
use MichaelDrennen\LocalFile\LocalFile; $lineCount = LocalFile::lineCount('/path/to/your/file.txt); echo $lineCount;
Split a text file into chunks. Each chunk has 1000 lines.
use MichaelDrennen\LocalFile\LocalFile; $splitFilePaths = LocalFile::split('/path/to/your/file.txt); print_r($splitFilePaths);