No idea why this post was changed or something because that's not what I posted. I copied and pasted it straight from my source and only changed the variables.
Anyways, here's the real version:
$row['post_content'] = str_replace(
array('<', '>', '&', ''', '"', '''),
array('<', '>', '&', '\'', '"', '\''),
Apparently the forum was taking some of the characters literally and used the character it represents to display. I fixed that in this post.