widont()
The widont function makes sure that there are no typographical widows at the end of a paragraph – that's a single word in the last line
widont(?string $string = null): string
Parameters
Name | Type | Default |
---|---|---|
$string | string |null |
null |
Return type
string
Example
<?php
$text = 'Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum id ligula porta felis euismod semper. Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod.';
echo widont($text);