strlen showing wrong character when at the end of the title is ë its showing “�…”
The is my code:
<?php $title = the_title('', '', false);
$title = (strlen($title)<60) ? $title : substr($title,0,50)."...";
echo $title;
<?php endforeach; ?>
strlen showing wrong character when at the end of the title is ë its showing “�…”
The is my code:
<?php $title = the_title('', '', false);
$title = (strlen($title)<60) ? $title : substr($title,0,50)."...";
echo $title;
<?php endforeach; ?>
You must be logged in to post a comment.
For unicode characters you need to use
mb_strlen()
andmb_substr()
Rewrite the above line to