Limit String Length January 26, 2023 by Tarik You can use something similar to the below: if (strlen($str) > 10) $str = substr($str, 0, 7) . '...';