sfneal / string-helpers
PHP string helper functions that add familiar functionality from other languages (like string contains, splitting, truncating, etc...)
Installs: 114 740
Dependents: 10
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- sfneal/array-helpers: ^3.0
Requires (Dev)
- orchestra/testbench: ^3.8|^6.24.1|^7.0
- phpunit/phpunit: ^7.5|^8.0 <8.5.12|^9.3
- scrutinizer/ocular: ^1.8
README
PHP string helper functions that add familiar functionality from other languages (like string contains, splitting, truncating, etc...)
Installation
You can install the package via composer:
composer require sfneal/string-helpers
In order to autoload to the helper functions add the following path to the autoload.files section in your composer.json.
"autoload": { "files": [ "vendor/sfneal/string-helpers/src/strings.php" ] },
Usage
Example use of the 'truncate' helper and method.
# using StringHelpers import use Sfneal\Helpers\Strings\StringHelpers; (new StringHelpers("here is a long string we'd like to truncate"))->truncate(12); >>> here is a lo... # using autloaded helpers truncateString("here is a long string we'd like to truncate", 12); >>> here is a lo...
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email stephen.neal14@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.