I've got a code that gets the number of characters in a post...
$num_chars = strlen(utf8_decode($content));
However, I'm having some trouble in that this count includes characters in html tags <img src="...">, <a href="...">, etc.
I use the character count to display a particular layout based on how long the post is, so I need the character count to be the number of characters displayed to a reader, and to not include the html code.
Any suggestions on the most efficient way to do that?