echo mb_strimwidth("Hello World", 0, 10, "..."); // output: "Hello W..."
if (strlen($str) > 10) $str = substr($str, 0, 7) . '...';