Jump to content

Character count - only characters


web_master

Recommended Posts

Hi,

 

I got in MySql database the text. The text looks like this example:

 

<p>Ommy num <strong>ad modip ea accum</strong> ea commy num <em>aut iliquam etueraestis nullao</em>r sequi blaor atem diamconullum ip eu feugiam, verosto eratisi.</p>
<p><br />Lorem dolutpatet veniametum dit ilis dolum vel ipit autem exero eugue digna facin vendre magna faciliquamet irit do do erciduis alit aliscilit wis ex ea at. Gait, quis nonsequamet amet, volobore volore molorem zzrit vel ut alit nos <span style="color: #ff0000;">nibh eu facilit lore</span> venim delent alisi tie dio exer adit, vullumsan žŽ Å‘Å éÉ ÑˆÐ¨Ð¨Ñ›Ñ› vel ipsum nonulla ortisis del utat, consendre magniscing ea facil dolorero odoluptat. Metummo dolore faciliquisi ting eu feugait utpatum vel utpatum vel exerosto od ecte velit esecte faccummy nonsectem <span style="text-decoration: line-through;">quat amet la feugue tet,</span> quis aliquat.<br /></p>

 

So, when I reload it from MySQl database, how can I count only characters without TAG's like: <span style="color: #ff0000;"> or <p><br /> or others?

Link to comment
Share on other sites

OK, I try strip_tags() and strlen() and add the html_entity_decode() too, but its not enough form me. Why?

 

I got the serbian characters like: čČćĆđ𚊞Ž (this is 10 character).

In HTML code: čČćĆđ𚊞Ž (this is 32 character)

 

The code is:

<?php 
$CharsPreCOunt = strip_tags(html_entity_decode($request['text']));
echo strlen($CharsPreCOunt);
?>

 

What can I do to counter count 10 characters?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.