Jump to content

Character count


web_master

Recommended Posts

I got another problem. It is a counting characters.

When I reload text from database, I want to count how many characters are in text. The problem is that I use the timymce, and there is a tags </p> and formats <span> and other formats. How can I count characters without those format, just pure characters entire text? I need a php code. And some plus - text is in utf8 coding in database with utf8 bin.

Link to comment
https://forums.phpfreaks.com/topic/257820-character-count/
Share on other sites

You could use strip_tags and strlen, perhaps.

 

I try this: strlen(strip_tags(html_entity_decode($request['text']))) but it still count tags when I wrote text in textarea the tinymce count correctly eg 28 characters, but after reload there is a 67 chars

Link to comment
https://forums.phpfreaks.com/topic/257820-character-count/#findComment-1321428
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.