by
0
6
1,813
1
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 12170th place

Published on:

Languagephp
LicenseMIT_X11

Just Trim

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/301740/Just-Trim?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
function justtrim($string, $lenght){ //$lenght = 22; $str_to_count = html_entity_decode($string); if (strlen($str_to_count) <= $lenght) { return $string; } $s2 = substr($str_to_count, 0, $lenght - 3); $s2 .= ".."; return $s2; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus