When I use substr() I get a strange character at the end
$articleText = substr($articleText,0,500);
I have an output of 500 c
ms_substr() also works excellently for removing strange trailing line breaks as well, which I was having trouble with after parsing html code. The problem was NOT handled by:
trim()
or:
var_dump(preg_match('/^\n|\n$/', $variable));
or:
str_replace (array('\r\n', '\n', '\r'), ' ', $text)
Don't catch.