nexuslinkservices/word-wrap-helper

Maintainers

Package info

github.com/nexuslinkservices/word-wrap-helper

Issues

pkg:composer/nexuslinkservices/word-wrap-helper

Statistics

Installs: 16

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.0 2016-09-19 14:22 UTC

This package is not auto-updated.

Last update: 2026-03-15 03:18:10 UTC


README

Wraps a string to a given number of characters using a string break character.

Latest Version Software License Scrutinizer Code Quality Build Status

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.