function ellipsis($long_string, $max_character = 30) { $short_string = strlen($long_string) > $max_character ? substr($long_string, 0, $max_character) . "..." : $long_string; return $short_string; }