Cut an arabic string
PHP Snippet 1:
mb_internal_encoding('UTF-8');
PHP Snippet 2:
return '...'.mb_substr($str, 0, $limit - 3, "UTF-8"); // UTF-8 is optional
PHP Snippet 3:
public static function shorten_arabic_text($text, $lenght)
{
mb_internal_encoding('UTF-8');
$out = mb_strlen($text) > $lenght ? mb_substr($text, 0, $lenght) . " ..." : $text;
return $out;
}