Reputation: 103
In some cases when I use substr() function, it returns this char � at the end of returned string.
$descrSh=substr($str,0,250);
How to solve this problem ???
Upvotes: 1
Views: 76
Reputation: 3795
Your substr cuts an multi-byte char in half! Use mb_substr() instead.
mb_substr($str,0,250, 'utf-8')
Upvotes: 1