Belgin Fish Belgin Fish -4 years ago 208
PHP Question

Limit String Length

I'm looking for a way to limit a string in php and add on ... at the end if the string was too long.

Answer Source
if (strlen($str) > 10)
   $str = substr($str, 0, 7) . '...';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download