When I use substr() I get a strange character at the end
substr()
$articleText = substr($articleText,0,500);
I have an output of 500 c
use this function, It worked for me
function substr_unicode($str, $s, $l = null) { return join("", array_slice( preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $s, $l)); }
Credits: http://php.net/manual/en/function.mb-substr.php#107698