Shorten a string for the given length
Parameters | |||
---|---|---|---|
string
|
$str |
A plain text string to be shortened |
# |
integer
|
$length = 50 |
The character count |
# |
string
|
$trail = '...' |
To append |
# |
Returns | |
---|---|
string
|
The shorten text string |