nexuslinkservices / word-wrap-helper
v1.0.0
2016-09-19 14:22 UTC
Requires
- php: >=5.6.2
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2024-11-09 20:07:04 UTC
README
Wraps a string to a given number of characters using a string break character.
Installation
If you use composer, you can add this package by running
composer require galiteintechnologies/word-wrap-helper
Usage
Default values are $width = 75, $break = '\n' and $cut = false.
<?php
use WordWrapHelper\WordFormatter;
$wordFormatter = new WordFormatter();
$content = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
$result = $wordFormatter->wrap($content, 30, '-<br/>');
echo $result;
Output
Lorem Ipsum is simply dummy-<br/>text of the printing and-<br/>typesetting industry.
CONTRIBUTING:
Pull requests are always welcome.