So I am using substr to limit how much of a news article I show. Here is the code:
substr(strip_tags($news['content']),0,$content_length) . '...';
The problem happens only in a blue moon.. when it tries to cut off near an apostrophe. I get the following output Hoye&#...
In this case, the $news['content']
is "Hoye's Pharmacy will be closed....."
. The $content_length
value in this case happens to be 8. Someone suggested trying mb_substr
but that did not fix the problem.