SkillAgentSearch skills...

Smartwrap

Smarter wordwrap for PHP

Install / Use

/learn @EmanueleCoppola/Smartwrap
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

EmanueleCoppola/smartwrap

I wrote this package because I faced the same problem as in this StackOverflow question.

Installation

composer require emanuelecoppola/smartwrap

Usage

use EmanueleCoppola\SmartWrap\SmartWrap;

$sw = new SmartWrap();

$wrapped = $sw->smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true);

print($wrapped);

// Or by using the global function
$wrapped = smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true);

print($wrapped);

Sample input/output

$output = wordwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true);
// The output will be ↓
$output == "hello!\nheeeeeeeeeeeeeeereis\naverylongword";

$output = smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true);
// The output will be ↓
$output == "hello! heeeeeeeeeeee\neeereisaverylongword";
View on GitHub
GitHub Stars6
CategoryDevelopment
Updated11mo ago
Forks1

Languages

PHP

Security Score

77/100

Audited on Apr 26, 2025

No findings