web-profile

php cut string utf-8

Cut string in php in utf-8 encoding (works with cyrillic symbols):

$string = mb_substr($string, 0, 50,'UTF-8'); // cut first 50 chars of the string

Leave a Reply

Your email address will not be published.