php set max string length code example
Example 1: php limit string length
if (strlen($str) > 10)
$str = substr($str, 0, 7) . '...';
Example 2: php string max length
$string = substr($string,0,255); //max 255 chars
if (strlen($str) > 10)
$str = substr($str, 0, 7) . '...';
$string = substr($string,0,255); //max 255 chars