I\'m looking for a way to limit a string in php and add on ... at the end if the string was too long.
In another way to limit a string in php and add on readmore text or like '...' using below code
if (strlen(preg_replace('#^https?://#', '', $string)) > 30) { echo substr(preg_replace('#^https?://#', '', $string), 0, 35).'…'; }